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

schema mismatch : awscc_xray_sampling_rule

Open quixoticmonk opened this issue 10 months 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_xray_sampling_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.

The configuration based on schema which doesn't work

resource "awscc_xray_sampling_rule" "example" {

  rule_name= "example"
  sampling_rule = {

    fixed_rate     = 0.05
    host           = "*"
    http_method    = "*"
    priority       = 9999
    reservoir_size = 1
    resource_arn   = "*"
    service_name   = "*"
    service_type   = "*"
    url_path       = "*"
    version = 1
  }

  tags = [
    {
      key   = "ModifiedBy"
      value = "AWSCC"
    }
  ]
}

The configuration which works

resource "awscc_xray_sampling_rule" "example" {


  sampling_rule = {
    rule_name = "example"
    fixed_rate     = 0.05
    host           = "*"
    http_method    = "*"
    priority       = 9999
    reservoir_size = 1
    resource_arn   = "*"
    service_name   = "*"
    service_type   = "*"
    url_path       = "*"
    version = 1
  }

  tags = [
    {
      key   = "ModifiedBy"
      value = "AWSCC"
    }
  ]
}

Cloudformation JSON reference : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-xray-samplingrule.html


{
   "AWSTemplateFormatVersion": "2010-09-09T00:00:00.000Z",
   "Resources": {
        "MySamplingRuleResource": {
         "Type": "AWS::XRay::SamplingRule",
         "Properties": {
            "SamplingRule": {
               "RuleName": "MySamplingRule",
               "ResourceARN": "*",
               "Priority": 2,
               "FixedRate": 0.05,
               "ReservoirSize": 50,
               "ServiceName": "MyServiceName",
               "ServiceType": "MyServiceType",
               "Host": "MyHost",
               "HTTPMethod": "GET",
               "URLPath": "*",
               "Version": 1
            }
         }
      }
   }
}
         

Debug Output

Panic Output

Expected Behavior

Terraform apply with the rule_name as an independent input. The sampling rule should be created.

Actual Behavior

The plan and terraform validate doesn't show any errors, but an apply is rejected.

Terraform used the selected providers to generate the following execution plan.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # awscc_xray_sampling_rule.example will be created
  + resource "awscc_xray_sampling_rule" "example" {
      + id                   = (known after apply)
      + rule_arn             = (known after apply)
      + rule_name            = "example"
      + sampling_rule        = {
          + attributes     = (known after apply)
          + fixed_rate     = 0.05
          + host           = "*"
          + http_method    = "*"
          + priority       = 9999
          + reservoir_size = 1
          + resource_arn   = "*"
          + rule_arn       = (known after apply)
          + rule_name      = (known after apply)
          + service_name   = "*"
          + service_type   = "*"
          + url_path       = "*"
          + version        = 1
        }
      + sampling_rule_record = (known after apply)
      + sampling_rule_update = (known after apply)
      + tags                 = [
          + {
              + key   = "ModifiedBy"
              + value = "AWSCC"
            },
        ]
    }

Plan: 1 to add, 0 to change, 0 to destroy.
awscc_xray_sampling_rule.example: Creating...
╷
│ Error: AWS SDK Go Service Operation Incomplete
│
│   with awscc_xray_sampling_rule.example,
│   on main.tf line 1, in resource "awscc_xray_sampling_rule" "example":
│    1: resource "awscc_xray_sampling_rule" "example" {
│
│ Waiting for Cloud Control API service CreateResource operation completion
│ returned: waiter state transitioned to FAILED. StatusMessage: Invalid request
│ provided: CreateSamplingRuleRequest(SamplingRule=SamplingRule(ResourceARN=*,
│ Priority=9999, FixedRate=0.05, ReservoirSize=1, ServiceName=*, ServiceType=*,
│ Host=*, HTTPMethod=*, URLPath=*, Version=1), Tags=[Tag(Key=ModifiedBy,
│ Value=AWSCC)]). ErrorCode: InvalidRequest

Steps to Reproduce

  1. terraform apply

Important Factoids

References

quixoticmonk avatar Apr 18 '24 18:04 quixoticmonk