terraform-provider-awscc icon indicating copy to clipboard operation
terraform-provider-awscc copied to clipboard

awscc_apigateway_account - internal error 50

Open wellsiau-aws opened this issue 1 year ago • 1 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.

Terraform CLI and Terraform AWS Cloud Control Provider Version

Affected Resource(s)

  • awscc_apigateway_account

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 avatar Dec 28 '23 17:12 wellsiau-aws

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"
    }
}

wellsiau-aws avatar Dec 28 '23 17:12 wellsiau-aws