Git Product home page Git Product logo

learn-terraform-provider-versioning's Introduction

learn-terraform-provider-versioning's People

Contributors

alanszlosek avatar duplo83 avatar hashicorp-copywrite[bot] avatar im2nguyen avatar judithpatudith avatar ritsok avatar robin-norwood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-terraform-provider-versioning's Issues

'~>' required_version is not supported anymore

On 'terraform init' command, following error message appear:
"""
│ Error: Unsupported Terraform Core version

│ on versions.tf line 14, in terraform:
│ 14: required_version = "~> 0.14"

│ This configuration does not support Terraform version 1.0.4. To proceed, either choose another supported Terraform version or update this version constraint. Version constraints are normally set for good
│ reason, so updating the constraint may lead to other errors or unexpected behavior.
"""

Bucket creation fails due to ACL setting

https://github.com/hashicorp/learn-terraform-provider-versioning/blob/38292721561b5c9f6030a7730e7faadf3a1e873f/main.tf#L16C3-L16C25

Received the following error on the initial Terraform Apply step instead of the deprecation warning output as referenced in the tutorial:

aws_s3_bucket.sample: Creating...
Error: Error creating S3 bucket: InvalidBucketAclWithObjectOwnership: Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting
│ status code: 400

Possibly due to changes made April 2023: ARTICLE

Was able to workaround and finish the tutorial by commenting out referenced line 16 in main.tf file and running Terraform Apply

The bucket is then created with defaults, and the tutorial can move forward to the ACL change section. However, the ACL manual change referenced in the article also fail on the next Terraform Apply step presumably for the same reason as the above issue cause:

resource "aws_s3_bucket_acl" "example" {
bucket = aws_s3_bucket.sample.id
acl = "public-read"
}

aws_s3_bucket_acl.example: Creating...
│ Error: creating S3 bucket ACL for [my-example-bucket]: AccessDenied: Access Denied
│ status code: 403

The following ACL block appears to accomplish public access:

resource "aws_s3_bucket_ownership_controls" "example" {
bucket = random_pet.petname.id
rule {
object_ownership = "BucketOwnerPreferred"
}
}

resource "aws_s3_bucket_public_access_block" "example" {
bucket = random_pet.petname.id

block_public_acls = false
block_public_policy = false
ignore_public_acls = false
restrict_public_buckets = false
}

resource "aws_s3_bucket_acl" "example" {
depends_on = [
aws_s3_bucket_ownership_controls.example,
aws_s3_bucket_public_access_block.example,
]

bucket = random_pet.petname.id
acl = "public-read"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.