Using Functions within custom Conformance Pack resources

0

Hi,

I need help to use a function that concatenates a parameter with a static value within a remediation rule.

I have the following custom Conformance Pack, where I want to define the AutomationAssumeRole as a parameter.

Parameters:
  ParamAutomationAssumeRole:
    Default: ComplianceRemediation
    Type: String
Resources:
  Ec2SecurityGroupAttachedToEni:
    Type: AWS::Config::ConfigRule
    Properties:
      ConfigRuleName: ec2-security-group-attached-to-eni
      Scope:
        ComplianceResourceTypes:
          - AWS::EC2::SecurityGroup
      Source:
        Owner: AWS
        SourceIdentifier: EC2_SECURITY_GROUP_ATTACHED_TO_ENI
  Ec2SecurityGroupAttachedToEniRemediation:
    DependsOn: Ec2SecurityGroupAttachedToEni
    Type: "AWS::Config::RemediationConfiguration"
    Properties:
      ConfigRuleName: ec2-security-group-attached-to-eni
      ResourceType: "AWS::EC2::SecurityGroup"
      TargetId: "AWSConfigRemediation-DeleteUnusedSecurityGroup"
      TargetType: "SSM_DOCUMENT"
      TargetVersion: "1"
      Parameters:
        GroupId:
          ResourceValue:
            Value: "RESOURCE_ID"
        AutomationAssumeRole:
          StaticValue:
            Values:
              Fn::Sub:
                  "arn:aws:iam::${AWS::AccountId}:role/${ParamAutomationAssumeRole}"

Based on this doc, I could use the "Fn::Sub:" function, but the Conformance Pack deployment fails with the following error: Conformance Pack deployment error

I'm not sure what I'm doing wrong here. Any help is much appreciated.

Thanks!

질문됨 일 년 전103회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠