Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform-tuesdays/2024-11-19-TAOPro1 #32

Open
VladimirKuletski opened this issue Nov 22, 2024 · 0 comments
Open

terraform-tuesdays/2024-11-19-TAOPro1 #32

VladimirKuletski opened this issue Nov 22, 2024 · 0 comments

Comments

@VladimirKuletski
Copy link

VladimirKuletski commented Nov 22, 2024

Hi Ned!
Not an issue but compliment!
First of all: Thanks a lot for cool example and video!

We can go down to Plan: 0 to add, 0 to change, 0 to destroy. if

  • ownership_controls and acl will be also included into moved
moved {
  from = aws_s3_bucket_ownership_controls.bucket
  to = module.s3_bucket.aws_s3_bucket_ownership_controls.this[0]
}

moved {
  from = aws_s3_bucket_acl.bucket_acl
  to = module.s3_bucket.aws_s3_bucket_acl.this[0]
}
  • import is allowed
terraform import module.s3_bucket.aws_s3_bucket_public_access_block.this[0] my-bucket-aaaaaaaa

Additionally, we can use data provider in module to avoid introducing extra variable vpc_id:

data "aws_subnet" "selected" {
  id = var.subnet_id
}

then just lookup VPC ID in security group resource:

vpc_id = data.aws_subnet.selected.vpc_id

Probably a bit of extension to your solution.

Thanks for your very detailed explanation! It was really fun to play with "zero changes" goal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant