Open aslatter opened 9 months ago
You are missing permissions for a few actions here. The minimum set of actions you need is
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"resource-groups:*", // probably not minimal
"cloudformation:CreateResource",
"cloudformation:GetResourceRequestStatus",
"servicecatalog:CreateApplication",
"cloudformation:GetResource",
"servicecatalog:GetApplication"
],
"Resource": "*" // not minimal
}
]
}
The requirement for cloudformation:GetResourceRequestStatus
is currently somewhat hidden. The other actions you can find by rinse-and-repeat terraform apply until you have all of the permissions :)
The waiter err
is not checked right away, this looks like an edge-case we haven't come across. At a quick glance this is also happening in the delete handler.
diff --git a/internal/generic/resource.go b/internal/generic/resource.go
index 8dcd9cb4a..e60166ee9 100644
--- a/internal/generic/resource.go
+++ b/internal/generic/resource.go
@@ -413,7 +413,11 @@ func (r *genericResource) Create(ctx context.Context, request resource.CreateReq
err = waiter.Wait(ctx, &cloudcontrol.GetResourceRequestStatusInput{RequestToken: output.ProgressEvent.RequestToken}, r.createTimeout)
- id := aws.ToString(progressEvent.Identifier)
+ var id string
+ if progressEvent != nil {
+ // progressEvent may be nil if the user does not have permissions to evaluate resource request status
+ id = aws.ToString(progressEvent.Identifier)
+ }
if err != nil {
response.Diagnostics.Append(ServiceOperationWaiterErrorDiag("Cloud Control API", "CreateResource", err))
Thanks! I was able to debug the permissions issue by setting the provider debug flag.
Further down the process I ran into a different error (not a crash) where my state file got corrupted because I was missing permissions to tag either the service catalog resources or the resource group.
Community Note
Terraform CLI and Terraform AWS Cloud Control Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
I'm applying this with a role which only has
resource-groups:*
andcloudformation:CreateResource
(among other likely unrelated permissions). I was attempting to iteratively perform applies and see what permissions were missing. I had just added thecloudformation:CreateResource
permission when I got this crash. I expect I'm missing more permissions - my backup plan is to read documentation.Debug Output
Panic Output
Expected Behavior
Not a SIGSEGV.
Actual Behavior
Panic etc.
Steps to Reproduce
terraform apply
Important Factoids
As described above - I am likely missing permissions required to perform the action.
References
0000