cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

AWS::EC2::VPC should include property enable-network-address-usage-metrics

Open reaperharvest opened this issue 3 years ago • 3 comments

Name of the resource

AWS::EC2::VPC

Resource name

No response

Description

AWS::EC2::VPC should have a new property value for the enable-network-address-usage-metrics (true | false) attribute that was recently added: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cloudwatch.html#nau-monitoring-enable

This property should be available at vpc creation and update time. Similar to how [EnableDnsHostnames] [EnableDnsSupport] are included in the cloudformation resource property.

Other Details

No response

reaperharvest avatar Nov 28 '22 15:11 reaperharvest

Any updates? I think this has been coming soon for 2 years

reaperharvest avatar Nov 08 '24 04:11 reaperharvest

Hi! Could someone from AWS give us an ETA on this one?

tvb avatar Mar 12 '25 16:03 tvb

I ended up using a custom resource to do this.

export class VpcNauMetricsEnabler extends Construct {
    constructor(scope: Construct, id: string, props: VpcNauMetricsEnablerProps) {
        super(scope, id);
 
        new cr.AwsCustomResource(this, "VpcEnableNetworkAddressUsageMetrics", {
            serviceTimeout: Duration.minutes(5),
            onCreate: {
                service: "EC2",
                action: "modifyVpcAttribute",
                parameters: {
                    VpcId: props.vpcId,
                    EnableNetworkAddressUsageMetrics: {
                        Value: true,
                    },
                },
                physicalResourceId: cr.PhysicalResourceId.of("NauMetricsEnalerPhysicalResourceId"),
            },
            policy: cr.AwsCustomResourcePolicy.fromSdkCalls({ resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE }),
            timeout: Duration.minutes(5),
        });
    }
}

// somewhere else
 new VpcNauMetricsEnabler(this, `NauMetricsEnabler`, {
            vpcId: this.vpc.vpcId,
  });

psnilesh avatar Apr 07 '25 17:04 psnilesh