Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aboutte/0532c669df1d66c411f35eb9eadc33fa to your computer and use it in GitHub Desktop.
Save aboutte/0532c669df1d66c411f35eb9eadc33fa to your computer and use it in GitHub Desktop.
Terraform AWS Provider Creating Minio Bucket
$ terraform -v
Terraform v0.11.7
aboutte@: ~/Desktop/terraform
$ terraform init
Initializing provider plugins...
The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.
* provider.aws: version = "~> 2.56"
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
aboutte@: ~/Desktop/terraform
$ cat main.tf
provider "aws" {
region = "us-east-1"
skip_credentials_validation = true
skip_requesting_account_id = true
s3_force_path_style = true
profile = "minio"
endpoints {
s3 = "https://minio.andyboutte.com"
}
}
resource "aws_s3_bucket" "b" {
bucket = "my-tf-test-bucket"
}
aboutte@: ~/Desktop/terraform
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_s3_bucket.b
id: <computed>
acceleration_status: <computed>
acl: "private"
arn: <computed>
bucket: "my-tf-test-bucket"
bucket_domain_name: <computed>
bucket_regional_domain_name: <computed>
force_destroy: "false"
hosted_zone_id: <computed>
region: <computed>
request_payer: <computed>
versioning.#: <computed>
website_domain: <computed>
website_endpoint: <computed>
Plan: 1 to add, 0 to change, 0 to destroy.
------------------------------------------------------------------------
Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.
aboutte@: ~/Desktop/k8s/minio
$ /Users/aboutte/.pyenv/versions/3.6.8/bin/aws --profile minio s3 ls
aboutte@: ~/Desktop/terraform
$ terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_s3_bucket.b
id: <computed>
acceleration_status: <computed>
acl: "private"
arn: <computed>
bucket: "my-tf-test-bucket"
bucket_domain_name: <computed>
bucket_regional_domain_name: <computed>
force_destroy: "false"
hosted_zone_id: <computed>
region: <computed>
request_payer: <computed>
versioning.#: <computed>
website_domain: <computed>
website_endpoint: <computed>
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
aws_s3_bucket.b: Creating...
acceleration_status: "" => "<computed>"
acl: "" => "private"
arn: "" => "<computed>"
bucket: "" => "my-tf-test-bucket"
bucket_domain_name: "" => "<computed>"
bucket_regional_domain_name: "" => "<computed>"
force_destroy: "" => "false"
hosted_zone_id: "" => "<computed>"
region: "" => "<computed>"
request_payer: "" => "<computed>"
versioning.#: "" => "<computed>"
website_domain: "" => "<computed>"
website_endpoint: "" => "<computed>"
Error: Error applying plan:
1 error(s) occurred:
* aws_s3_bucket.b: 1 error(s) occurred:
* aws_s3_bucket.b: unexpected EOF
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
panic: runtime error: invalid memory address or nil pointer dereference
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x44620da]
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4:
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: goroutine 101 [running]:
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags.KeyValueTags.Map(0xc000d33680, 0xc000d33680)
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags/key_value_tags.go:138 +0xda
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsS3BucketRead(0xc00044e380, 0x5a20720, 0xc000491900, 0x203000, 0x203000)
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_s3_bucket.go:1343 +0x3f63
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsS3BucketUpdate(0xc00044e380, 0x5a20720, 0xc000491900, 0x0, 0xc000ad27c0)
2020-04-06T20:24:52.915-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_s3_bucket.go:821 +0x340
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsS3BucketCreate(0xc00044e380, 0x5a20720, 0xc000491900, 0xc00044e380, 0x0)
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_s3_bucket.go:725 +0x7b7
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc000fd8900, 0xc0005b4140, 0xc000ad25e0, 0x5a20720, 0xc000491900, 0x1, 0xc0008e9ba8, 0x100bbf6)
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:305 +0x365
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc000fcd380, 0xc00067a4c0, 0xc0005b4140, 0xc000ad25e0, 0xc00067c480, 0xc000d3e120, 0x18)
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:294 +0x99
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: github.com/hashicorp/terraform-plugin-sdk/plugin.(*ResourceProviderServer).Apply(0xc00085e3c0, 0xc000ad21a0, 0xc0006c4cc0, 0x0, 0x0)
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/plugin/resource_provider.go:530 +0x57
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: reflect.Value.call(0xc00007a8a0, 0xc000128018, 0x13, 0x64e6e42, 0x4, 0xc0008e9f18, 0x3, 0x3, 0x0, 0x0, ...)
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/goenv/versions/1.13.7/src/reflect/value.go:460 +0x5f6
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: reflect.Value.Call(0xc00007a8a0, 0xc000128018, 0x13, 0xc0008fbf18, 0x3, 0x3, 0x0, 0x0, 0x0)
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/goenv/versions/1.13.7/src/reflect/value.go:321 +0xb4
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: net/rpc.(*service).call(0xc00012e000, 0xc000d480f0, 0xc000d42050, 0xc000d42060, 0xc000972300, 0xc000be8620, 0x5239ec0, 0xc000ad21a0, 0x16, 0x5239f00, ...)
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/goenv/versions/1.13.7/src/net/rpc/server.go:377 +0x16f
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: created by net/rpc.(*Server).ServeCodec
2020-04-06T20:24:52.916-0500 [DEBUG] plugin.terraform-provider-aws_v2.56.0_x4: /opt/goenv/versions/1.13.7/src/net/rpc/server.go:474 +0x42b
2020-04-06T20:24:52.921-0500 [DEBUG] plugin: plugin process exited: path=/Users/aboutte/Desktop/terraform/.terraform/plugins/darwin_amd64/terraform-provider-aws_v2.56.0_x4
2020/04/06 20:24:52 [TRACE] root: eval: *terraform.EvalWriteState
2020/04/06 20:24:52 [TRACE] root: eval: *terraform.EvalApplyProvisioners
2020/04/06 20:24:52 [TRACE] root: eval: *terraform.EvalIf
2020/04/06 20:24:52 [TRACE] root: eval: *terraform.EvalWriteState
2020/04/06 20:24:52 [TRACE] root: eval: *terraform.EvalWriteDiff
2020/04/06 20:24:52 [TRACE] root: eval: *terraform.EvalApplyPost
2020/04/06 20:24:52 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:
* aws_s3_bucket.b: unexpected EOF
2020/04/06 20:24:52 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:
* aws_s3_bucket.b: unexpected EOF
2020/04/06 20:24:52 [TRACE] [walkApply] Exiting eval tree: aws_s3_bucket.b
2020/04/06 20:24:52 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2020/04/06 20:24:52 [TRACE] dag/walk: upstream errored, not walking "provider.aws (close)"
2020/04/06 20:24:52 [TRACE] dag/walk: upstream errored, not walking "root"
2020/04/06 20:24:52 [TRACE] Preserving existing state lineage "d05136c1-8c1c-b60f-3222-3b253d7f3e9b"
2020/04/06 20:24:52 [DEBUG] plugin: waiting for all plugin processes to complete...
2020-04-06T20:24:52.936-0500 [WARN ] plugin: error closing client during Kill: err="connection is shut down"
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.
When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.
[1]: https://github.com/hashicorp/terraform/issues
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
aboutte@: ~/Desktop/terraform
$ /Users/aboutte/.pyenv/versions/3.6.8/bin/aws --profile minio s3 ls
2020-04-06 20:24:52 my-tf-test-bucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment