Last active
January 11, 2020 22:48
-
-
Save grimm26/e973a686526f9d054224d251b713aae6 to your computer and use it in GitHub Desktop.
bucket_create_one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
region = "us-east-2" | |
} | |
module "bucket" { | |
source = "./s3_bucket" | |
name = "testbucketkjhqer98iuh" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "name" { | |
type = string | |
} | |
resource "aws_s3_bucket" "b" { | |
count = 1 | |
bucket = var.name | |
acl = "private" | |
tags = { | |
Name = var.name | |
} | |
} | |
output "id" { | |
value = aws_s3_bucket.b[0].id | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "name" { | |
type = string | |
} | |
resource "aws_s3_bucket" "b" { | |
#count = 1 | |
bucket = var.name | |
acl = "private" | |
tags = { | |
Name = var.name | |
} | |
} | |
output "id" { | |
#value = aws_s3_bucket.b[0].id | |
value = aws_s3_bucket.b.id | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 4, | |
"terraform_version": "0.12.19", | |
"serial": 1, | |
"lineage": "e0cd159a-1c52-d321-3215-ffe5323db4ea", | |
"outputs": {}, | |
"resources": [ | |
{ | |
"module": "module.bucket", | |
"mode": "managed", | |
"type": "aws_s3_bucket", | |
"name": "b", | |
"each": "list", | |
"provider": "provider.aws", | |
"instances": [ | |
{ | |
"index_key": 0, | |
"schema_version": 0, | |
"attributes": { | |
"acceleration_status": "", | |
"acl": "private", | |
"arn": "arn:aws:s3:::testbucketkjhqer98iuh", | |
"bucket": "testbucketkjhqer98iuh", | |
"bucket_domain_name": "testbucketkjhqer98iuh.s3.amazonaws.com", | |
"bucket_prefix": null, | |
"bucket_regional_domain_name": "testbucketkjhqer98iuh.s3.us-east-2.amazonaws.com", | |
"cors_rule": [], | |
"force_destroy": false, | |
"hosted_zone_id": "Z2O1EMRO9K5GLX", | |
"id": "testbucketkjhqer98iuh", | |
"lifecycle_rule": [], | |
"logging": [], | |
"object_lock_configuration": [], | |
"policy": null, | |
"region": "us-east-2", | |
"replication_configuration": [], | |
"request_payer": "BucketOwner", | |
"server_side_encryption_configuration": [], | |
"tags": { | |
"Name": "testbucketkjhqer98iuh" | |
}, | |
"versioning": [ | |
{ | |
"enabled": false, | |
"mfa_delete": false | |
} | |
], | |
"website": [], | |
"website_domain": null, | |
"website_endpoint": null | |
}, | |
"private": "bnVsbA==" | |
} | |
] | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 4, | |
"terraform_version": "0.12.19", | |
"serial": 2, | |
"lineage": "e0cd159a-1c52-d321-3215-ffe5323db4ea", | |
"outputs": {}, | |
"resources": [ | |
{ | |
"module": "module.bucket", | |
"mode": "managed", | |
"type": "aws_s3_bucket", | |
"name": "b", | |
"each": "list", | |
"provider": "provider.aws", | |
"instances": [ | |
{ | |
"schema_version": 0, | |
"attributes": { | |
"acceleration_status": "", | |
"acl": "private", | |
"arn": "arn:aws:s3:::testbucketkjhqer98iuh", | |
"bucket": "testbucketkjhqer98iuh", | |
"bucket_domain_name": "testbucketkjhqer98iuh.s3.amazonaws.com", | |
"bucket_prefix": null, | |
"bucket_regional_domain_name": "testbucketkjhqer98iuh.s3.us-east-2.amazonaws.com", | |
"cors_rule": [], | |
"force_destroy": false, | |
"hosted_zone_id": "Z2O1EMRO9K5GLX", | |
"id": "testbucketkjhqer98iuh", | |
"lifecycle_rule": [], | |
"logging": [], | |
"object_lock_configuration": [], | |
"policy": null, | |
"region": "us-east-2", | |
"replication_configuration": [], | |
"request_payer": "BucketOwner", | |
"server_side_encryption_configuration": [], | |
"tags": { | |
"Name": "testbucketkjhqer98iuh" | |
}, | |
"versioning": [ | |
{ | |
"enabled": false, | |
"mfa_delete": false | |
} | |
], | |
"website": [], | |
"website_domain": null, | |
"website_endpoint": null | |
}, | |
"private": "bnVsbA==" | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment