1

I am getting error in the last parameter where I have to mention the value of TrailName and KMSKeyId. Both of these are getting incorrect while creating CFT from yaml file. The exact error is : (Service: AmazonConfig; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 78f748ce-c07e-4552-8d6b-d156b83475b7; Proxy: null) Error Screenshot

Please help me with the right syntax for parameter value for manual remediation.

AWSTemplateFormatVersion: "2010-09-09"
Description: ""
Resources:
  ConfigRuleForCloudTrailEncryption:
    Type: "AWS::Config::ConfigRule"
    Properties:
      ConfigRuleName: "cloud-trail-encryption"
      Scope:
        ComplianceResourceTypes: []
      Description: "A config rule that checks whether AWS CloudTrail is configured to use the server side encryption (SSE) AWS Key Management Service (AWS KMS) customer master key (CMK) encryption. The rule is COMPLIANT if the KmsKeyId is defined."
      Source:
        Owner: "AWS"
        SourceIdentifier: "CLOUD_TRAIL_ENCRYPTION_ENABLED"
      MaximumExecutionFrequency: "TwentyFour_Hours"
  RemediationForConfigRule:
    Type: "AWS::Config::RemediationConfiguration"
    Properties:
      Automatic: false
      ConfigRuleName:
        Ref: "ConfigRuleForCloudTrailEncryption"
      MaximumAutomaticAttempts: 5
      RetryAttemptSeconds: 60
      TargetId: "AWS-EnableCloudTrailKmsEncryption"
      TargetType: "SSM_DOCUMENT"
      TargetVersion: "1"
      Parameters:
        TrailNames:
          StaticValue:
            Value: "stringnamefortrail"
        KmsKeyId:
          StaticValue:
            Value: "KeyId/Keyarn"
Parameters: {}
Metadata: {}
Conditions: {}
Sanyam Grover
  • 100
  • 1
  • 8

1 Answers1

2

In the example of this aws-doc, you can find that Parameters value should be a list using -.

Fail

      Parameters:
        TrailNames:
          StaticValue:
            Value: "stringnamefortrail"

Fixed

      Parameters:
        TrailNames:
          StaticValue:
            Value: 
            - "stringnamefortrail"
shimo
  • 2,156
  • 4
  • 17
  • 21