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

awscc_events_rule - internal error

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_events_rule

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

resource "awscc_events_event_bus" "example" {
  name = "CrossRegionDestinationBus"
}

resource "awscc_events_rule" "example" {
  description    = "Routes to us-east-1 event bus"
  event_bus_name = "MyBusName"
  state          = "ENABLED"

  event_pattern = jsonencode({
    "source" : ["MyTestApp"],
    "detail" : ["MyTestAppDetail"]
  })

  targets = [{
    arn      = awscc_events_event_bus.example.arn
    id       = "CrossRegionDestinationBus"
    role_arn = awscc_iam_role.example.arn
  }]
}

resource "awscc_iam_role" "example" {
  assume_role_policy_document = jsonencode({
    "Version" : "2012-10-17",
    "Statement" : [
      {
        "Effect" : "Allow",
        "Principal" : {
          "Service" : "events.amazonaws.com"
        },
        "Action" : "sts:AssumeRole"
      }
    ]
  })

  path = "/"
  policies = [
    {
      policy_document = data.aws_iam_policy_document.example.json
      policy_name     = "PutEventsDestinationBus"
    }
  ]
}

data "aws_iam_policy_document" "example" {
  statement {
    sid       = "PutEventsDestinationBus"
    effect    = "Allow"
    actions   = ["events:PutEvents"]
    resources = [awscc_events_event_bus.example.arn]
  }
}

Expected Behavior

Plan / apply finished succesfully

Actual Behavior

Plan: 1 to add, 1 to change, 0 to destroy.
awscc_events_rule.example: Creating...
awscc_iam_role.example: Modifying... [id=sXu3ltB1Hsl7ashVdReJxb4E9-gM8223F6rZ9a]
awscc_iam_role.example: Still modifying... [id=sXu3ltB1Hsl7ashVdReJxb4E9-gM8223F6rZ9a, 10s elapsed]
awscc_iam_role.example: Still modifying... [id=sXu3ltB1Hsl7ashVdReJxb4E9-gM8223F6rZ9a, 20s elapsed]
awscc_iam_role.example: Modifications complete after 28s [id=sXu3ltB1Hsl7ashVdReJxb4E9-gM8223F6rZ9a]
╷
│ Error: AWS SDK Go Service Operation Incomplete
│ 
│   with awscc_events_rule.example,
│   on main.tf line 7, in resource "awscc_events_rule" "example":
│    7: resource "awscc_events_rule" "example" {
│ 
│ Waiting for Cloud Control API service CreateResource operation completion returned: waiter state transitioned to FAILED. StatusMessage: . ErrorCode: InternalFailure

Steps to Reproduce

  1. terraform apply

Important Factoids

References

wellsiau-aws avatar Dec 21 '23 21:12 wellsiau-aws

upstream issue, I can replicate this via CCAPI

aws cloudcontrol create-resource   --type-name AWS::Events::Rule   --desired-state file://state.json
{
    "ProgressEvent": {
        "TypeName": "AWS::Events::Rule",
        "RequestToken": "f2a19968-fc64-4649-8409-49bd90c812e3",
        "Operation": "CREATE",
        "OperationStatus": "IN_PROGRESS",
        "EventTime": "2023-12-21T13:03:53.217000-08:00"
    }
aws cloudcontrol get-resource-request-status --request-token $TOKEN
{
    "ProgressEvent": {
        "TypeName": "AWS::Events::Rule",
        "RequestToken": "f2a19968-fc64-4649-8409-49bd90c812e3",
        "Operation": "CREATE",
        "OperationStatus": "FAILED",
        "EventTime": "2023-12-21T13:03:53.356000-08:00",
        "ErrorCode": "InternalFailure"
    }
}

wellsiau-aws avatar Dec 21 '23 21:12 wellsiau-aws