hashicorp / terraform-provider-awscc

Terraform AWS Cloud Control provider
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs
Mozilla Public License 2.0
239 stars 107 forks source link

awscc_apigateway_account - internal error 50 #1379

Open wellsiau-aws opened 6 months ago

wellsiau-aws commented 6 months ago

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.

data "aws_caller_identity" "current" {}

data "aws_iam_policy_document" "cloudwatch_role_policy" {
  statement {
    effect = "Allow"
    principals {
      identifiers = ["apigateway.amazonaws.com"]
      type        = "Service"
    }
    actions = ["sts:AssumeRole"]
  }
}

resource "aws_iam_role" "cloudwatch" {
  name               = "cloudwatch"
  assume_role_policy = data.aws_iam_policy_document.cloudwatch_role_policy.json
}

resource "aws_iam_role_policy_attachment" "cloudwatch" {
  role       = aws_iam_role.cloudwatch.name
  policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs"
}

resource "awscc_apigateway_account" "example" {
  cloudwatch_role_arn = aws_iam_role.cloudwatch.arn
}

Expected Behavior

Terraform apply should run successfully

Actual Behavior

awscc_apigateway_account.example: Creating...
╷
│ Error: AWS SDK Go Service Operation Incomplete
│ 
│   with awscc_apigateway_account.example,
│   on main.tf line 24, in resource "awscc_apigateway_account" "example":
│   24: resource "awscc_apigateway_account" "example" {
│ 
│ Waiting for Cloud Control API service CreateResource operation completion returned: waiter state transitioned to FAILED. StatusMessage: Internal error occurred.. ErrorCode:
│ InternalFailure

Steps to Reproduce

  1. terraform apply
wellsiau-aws commented 6 months ago

I can replicate this via standard CCAPI call, likely upstream issue

aws cloudcontrol create-resource   --type-name AWS::ApiGateway::Account   --desired-state file://state.json
{
    "ProgressEvent": {
        "TypeName": "AWS::ApiGateway::Account",
        "RequestToken": "471d9059-77ba-4aa1-8d16-47cd456edce5",
        "Operation": "CREATE",
        "OperationStatus": "IN_PROGRESS",
        "EventTime": "2023-12-28T09:20:15.618000-08:00"
    }
}
aws cloudcontrol get-resource-request-status --request-token $TOKEN
{
    "ProgressEvent": {
        "TypeName": "AWS::ApiGateway::Account",
        "RequestToken": "471d9059-77ba-4aa1-8d16-47cd456edce5",
        "Operation": "CREATE",
        "OperationStatus": "FAILED",
        "EventTime": "2023-12-28T09:20:16.262000-08:00",
        "StatusMessage": "Internal error occurred.",
        "ErrorCode": "InternalFailure"
    }
}