Skip to content

(AWS Config): EC2_INTERNET_GATEWAY maps to the wrong Resource Type #16463

@Pandafriendd

Description

@Pandafriendd

EC2_INTERNET_GATEWAY maps to the wrong Resource Type

Reproduction Steps

This bug can be replicated by below snippet:

new config.ManagedRule(this, "myRule", {
      identifier: config.ManagedRuleIdentifiers.INTERNET_GATEWAY_AUTHORIZED_VPC_ONLY,
      ruleScope: config.RuleScope.fromResource(config.ResourceType.EC2_INTERNET_GATEWAY),
    })

Synthesized template looked like:

Resources:
  myRule463F9234:
    Type: AWS::Config::ConfigRule
    Properties:
      Source:
        Owner: AWS
        SourceIdentifier: INTERNET_GATEWAY_AUTHORIZED_VPC_ONLY
      Scope:
        ComplianceResourceTypes:
          - AWS::EC2::CustomerGateway

What did you expect to happen?

ComplianceResourceTypes in synthesized template should be AWS::EC2::InternetGateway rather than AWS::EC2::CustomerGateway

What actually happened?

public static readonly EC2_INTERNET_GATEWAY = new ResourceType('AWS::EC2::CustomerGateway');

Which should be mapped to AWS::EC2::InternetGateway

Environment

  • CDK CLI Version :
  • Framework Version:
  • Node.js Version:
  • OS :
  • Language (Version):

Other


This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-configRelated to AWS ConfigbugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions