Skip to content
GitHubXDiscord

IPAMResourceDiscoveryAssociation

The IPAMResourceDiscoveryAssociation resource allows you to associate an IPAM (IP Address Manager) resource discovery with your AWS EC2 resources. This resource is important for managing IP addresses across your AWS account. For more detailed information, refer to the AWS EC2 IPAMResourceDiscoveryAssociations documentation.

Create a basic IPAM resource discovery association using required properties and a common optional tag.

import AWS from "alchemy/aws/control";
const ipamAssociation = await AWS.EC2.IPAMResourceDiscoveryAssociation("basicIpamAssociation", {
IpamId: "ipam-12345678",
IpamResourceDiscoveryId: "discovery-12345678",
Tags: [{
Key: "Environment",
Value: "Development"
}]
});

Configure an IPAM resource discovery association to adopt existing resources if they already exist.

const advancedIpamAssociation = await AWS.EC2.IPAMResourceDiscoveryAssociation("advancedIpamAssociation", {
IpamId: "ipam-87654321",
IpamResourceDiscoveryId: "discovery-87654321",
adopt: true,
Tags: [{
Key: "Project",
Value: "Migration"
}]
});

Create an IPAM resource discovery association with multiple tags for better resource management and organization.

const taggedIpamAssociation = await AWS.EC2.IPAMResourceDiscoveryAssociation("taggedIpamAssociation", {
IpamId: "ipam-abcdef12",
IpamResourceDiscoveryId: "discovery-abcdef12",
Tags: [
{
Key: "Owner",
Value: "TeamA"
},
{
Key: "CostCenter",
Value: "CC123"
}
]
});