Closed MaxymVlasov closed 5 months ago
Bypassing call to data "aws_iam_instance_profile" "given".
data "aws_iam_instance_profile" "given"
Prevent module fails here: https://github.com/cloudposse/terraform-aws-ec2-instance/blob/596216fbdec0f1a9246c24cf1bd51e23e5734a15/main.tf#L84-L87
when you run terraform plan and when you create an instance profile in the same root module
terraform plan
resource "aws_iam_instance_profile" "default" { count = module.this.enabled ? 1 : 0 name = module.this.id role = aws_iam_role.default[0].name } module "mongodb_ec2" { source = "cloudposse/ec2-instance/aws" version = "1.2.1" instance_profile = aws_iam_instance_profile.default[0].name ...
Currently, you need to create IAM somewhere else or in 2 applies, otherwise you'' face next error:
P.S. I don't get how to run terraform-docs in this repo, so some additional polishing could be needed. Plus var name probably could be better
terraform-docs
nwm, we just need to unset instance_profile
instance_profile
what
Bypassing call to
data "aws_iam_instance_profile" "given"
.Prevent module fails here: https://github.com/cloudposse/terraform-aws-ec2-instance/blob/596216fbdec0f1a9246c24cf1bd51e23e5734a15/main.tf#L84-L87
when you run
terraform plan
and when you create an instance profile in the same root modulewhy
Currently, you need to create IAM somewhere else or in 2 applies, otherwise you'' face next error:
P.S. I don't get how to run
terraform-docs
in this repo, so some additional polishing could be needed. Plus var name probably could be better