hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.84k stars 9.19k forks source link

[Bug]: Terraform Apply Hangs Indefinitely When associating a principal to a service catalog portfolio #40146

Open cdavis21 opened 5 hours ago

cdavis21 commented 5 hours ago

Terraform Core Version

1.9.8

AWS Provider Version

5.76.0

Affected Resource(s)

resource "aws_servicecatalog_principal_portfolio_association"

Expected Behavior

Associate the principal to the portfolio and apply command completes with success.

Actual Behavior

Getting aws_servicecatalog_principal_portfolio_association.principal_arn: Still creating... [50s elapsed] Indefinitely Principal successfully gets associated, but apply won't complete.

Relevant Error/Panic Output Snippet

aws_servicecatalog_principal_portfolio_association.principal_arn: Creating...
aws_iam_role_policy.service_catalog: Modifying... [id=ServiceCatalogEndUserRole:ServiceCatalogEndUserPolicy]
aws_iam_role_policy.service_catalog: Modifications complete after 1s [id=ServiceCatalogEndUserRole:ServiceCatalogEndUserPolicy]
aws_servicecatalog_principal_portfolio_association.principal_arn: Still creating... [10s elapsed]
aws_servicecatalog_principal_portfolio_association.principal_arn: Still creating... [20s elapsed]
aws_servicecatalog_principal_portfolio_association.principal_arn: Still creating... [30s elapsed]
aws_servicecatalog_principal_portfolio_association.principal_arn: Still creating... [40s elapsed]
aws_servicecatalog_principal_portfolio_association.principal_arn: Still creating... [50s elapsed]
aws_servicecatalog_principal_portfolio_association.principal_arn: Still creating... [1m0s elapsed]
aws_servicecatalog_principal_portfolio_association.principal_arn: Still creating... [1m10s elapsed]
^C

Terraform Configuration Files

Note* i only added the applicable snippet. Code requires an s3 bucket with cfn template in it

resource "aws_servicecatalog_portfolio" "demo" { name = "Demo Portfolio" description = "Portfolio containing EC2 products" provider_name = "IT Team" }

resource "aws_servicecatalog_product" "ec2" { name = "Simple EC2 Instance" owner = "IT Team" description = "Launches a simple EC2 instance" type = "CLOUD_FORMATION_TEMPLATE"

provisioning_artifact_parameters { name = "v1.0" description = "Initial version" disable_template_validation = true type = "CLOUD_FORMATION_TEMPLATE" template_url = "https://s3.amazonaws.com/${aws_s3_bucket.service_catalog.id}/${aws_s3_object.ec2.key}" } }

resource "aws_servicecatalog_product_portfolio_association" "demo" { portfolio_id = aws_servicecatalog_portfolio.demo.id product_id = aws_servicecatalog_product.ec2.id }

resource "aws_servicecatalog_principal_portfolio_association" "principal_arn" { portfolio_id = aws_servicecatalog_portfolio.demo.id principal_arn = var.principal_arn principal_type = "IAM" }

resource "aws_servicecatalog_constraint" "demo" { description = "Launch constraint for EC2 product" portfolio_id = aws_servicecatalog_portfolio.demo.id product_id = aws_servicecatalog_product.ec2.id type = "LAUNCH"

parameters = jsonencode({ "RoleArn": "${aws_iam_role.service_catalog.arn}" }) }

Steps to Reproduce

terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 5 hours ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue