Difference between revisions of "Terraform resource: aws s3 bucket"
Jump to navigation
Jump to search
(36 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket | * https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket | ||
+ | == Arguments == | ||
+ | * <code>[[versioning]]</code> (deprecated), use Terraform resource <code>[[aws_s3_versioning]]</code> https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_versioning | ||
+ | * <code>[[logging]]</code> | ||
+ | * [[AWS S3 lifecycle|Lifecycle]]: <code>[[lifecycle_rule]]</code>. Resource: <code>[[aws_s3_bucket_lifecycle_configuration]]</code> | ||
+ | * [[AWS S3 replication|Replication]]: <code>[[replication_configuration]]</code> | ||
+ | * [[Terraform resource: aws s3 bucket server side encryption configuration]] | ||
+ | * <code>[[expired_object_delete_marker]]</code> | ||
+ | * <code>[[routing_rules]]</code> | ||
+ | * <code>[[server_side_encryption_configuration]]</code> (deprecated) | ||
+ | == Examples == | ||
resource "aws_s3_bucket" "my-resource-bucket" { | resource "aws_s3_bucket" "my-resource-bucket" { | ||
− | bucket = "my-tf-test-bucket" | + | [[bucket]] = "my-tf-test-bucket" |
tags = { | tags = { | ||
Line 11: | Line 21: | ||
} | } | ||
− | == | + | |
− | + | * [[Official aws cloudfront distribution example]] | |
− | + | ||
− | + | == Messages == | |
− | + | [[Error: creating Amazon S3 (Simple Storage) Bucket (yourbucketname): bucket already exists]] | |
+ | |||
+ | # aws_s3_bucket.your_bucket [[has moved to]] aws_s3_bucket.your_bucket[0] | ||
+ | |||
+ | [[Error: validating S3 Bucket]] (your_wrong_name) name: only lowercase alphanumeric characters and hyphens allowed in "your_wrong_name" | ||
+ | |||
+ | |||
+ | Error: creating Amazon S3 (Simple Storage) Bucket (your-bucket-name): [[BucketAlreadyExists]]: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again. | ||
+ | |||
+ | [[Error: putting S3 policy: AccessDenied: Access Denied]] | ||
== Related == | == Related == | ||
* [[Terraform resource: aws_s3_bucket_versioning]] | * [[Terraform resource: aws_s3_bucket_versioning]] | ||
+ | * <code>[[aws_s3_bucket_notification]]</code> | ||
+ | * <code>[[aws_s3_bucket_inventory]]</code> | ||
+ | * <code>[[aws_s3_bucket_lifecycle_configuration]]</code> | ||
+ | * <code>[[aws_s3control_bucket_lifecycle_configuration]]</code> | ||
+ | * <code>[[aws_s3_object]]</code> | ||
+ | * [[Terraform data source: aws_s3_bucket]] | ||
+ | * <code>[[aws_s3_bucket_cors_configuration]]</code> | ||
== See also == | == See also == | ||
− | * {{ | + | * {{aws_s3_bucket}} |
− | * {{terraform | + | * {{terraform S3 resources}} |
+ | * {{tf s3}} | ||
[[Category:Terraform]] | [[Category:Terraform]] |
Latest revision as of 08:31, 19 June 2024
Contents
Arguments[edit]
versioning
(deprecated), use Terraform resourceaws_s3_versioning
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_versioninglogging
- Lifecycle:
lifecycle_rule
. Resource:aws_s3_bucket_lifecycle_configuration
- Replication:
replication_configuration
- Terraform resource: aws s3 bucket server side encryption configuration
expired_object_delete_marker
routing_rules
server_side_encryption_configuration
(deprecated)
Examples[edit]
resource "aws_s3_bucket" "my-resource-bucket" { bucket = "my-tf-test-bucket" tags = { Name = "My bucket" Environment = "Dev" } }
Messages[edit]
Error: creating Amazon S3 (Simple Storage) Bucket (yourbucketname): bucket already exists
# aws_s3_bucket.your_bucket has moved to aws_s3_bucket.your_bucket[0]
Error: validating S3 Bucket (your_wrong_name) name: only lowercase alphanumeric characters and hyphens allowed in "your_wrong_name"
Error: creating Amazon S3 (Simple Storage) Bucket (your-bucket-name): BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.
Error: putting S3 policy: AccessDenied: Access Denied
Related[edit]
- Terraform resource: aws_s3_bucket_versioning
aws_s3_bucket_notification
aws_s3_bucket_inventory
aws_s3_bucket_lifecycle_configuration
aws_s3control_bucket_lifecycle_configuration
aws_s3_object
- Terraform data source: aws_s3_bucket
aws_s3_bucket_cors_configuration
See also[edit]
- Terraform s3:
aws_s3_bucket, aws_s3_bucket_notification
- Terraform s3 resources:
aws_s3_bucket
,aws_s3_bucket_lifecycle_configuration
,aws_s3control_bucket_lifecycle_configuration
,aws_s3 bucket_notification, aws_s3_bucket_website_configuration, aws_s3_bucket_versioning
- Terraform S3 resources:
aws_s3_bucket, aws_s3_object, aws_s3_bucket_policy, aws_s3_bucket_acl, aws_s3_bucket_website_configuration, aws_s3_bucket cors_configuration, aws_s3_account_public_access_block
, Terraform module: s3-bucket,aws_s3_bucket_versioning, aws_s3_bucket_server_side_encryption_configuration, aws_s3_bucket_logging
Advertising: