Open quixoticmonk opened 1 month ago
Could be related to https://github.com/hashicorp/terraform-provider-awscc/issues/509
Based on the input from #509 you could fix this with the configuration below.
resource "awscc_iam_role" "example" {
role_name = "sample_iam_role"
description = "This is a sample IAM role"
assume_role_policy_document = jsonencode(jsondecode(data.aws_iam_policy_document.instance_assume_role_policy.json))
path = "/"
policies = [{
policy_document = jsonencode(jsondecode(data.aws_iam_policy_document.sample_inline_1.json))
policy_name = "fist_inline_policy"
}]
}
data "aws_iam_policy_document" "instance_assume_role_policy" {
statement {
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["ec2.amazonaws.com"]
}
}
}
data "aws_iam_policy_document" "sample_inline_1" {
statement {
sid = "AccessS3"
actions = ["s3:ListAllMyBuckets", "s3:ListBucket", "s3:HeadBucket"]
resources = ["*"]
}
}
Community Note
Terraform CLI and Terraform AWS Cloud Control Provider Version
Affected Resource(s)
Terraform Configuration Files
Baseline configuation:
Debug Output
Panic Output
Expected Behavior
Terraform apply should maintain the idempotency.
Actual Behavior
With no changes, provider is identifying change and shows a drift
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
References
0000