AWS::EC2::VPC should include property enable-network-address-usage-metrics
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
Any updates? I think this has been coming soon for 2 years
Hi! Could someone from AWS give us an ETA on this one?
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,
});