ServiceNetworkResourceAssociation
The ServiceNetworkResourceAssociation resource allows you to manage associations between service networks and resources in AWS VpcLattice. This facilitates the integration of your services in a networked environment. For more information, visit the AWS VpcLattice ServiceNetworkResourceAssociations documentation.
Minimal Example
Section titled “Minimal Example”Create a basic ServiceNetworkResourceAssociation with required properties and a common optional property.
import AWS from "alchemy/aws/control";
const serviceNetworkAssociation = await AWS.VpcLattice.ServiceNetworkResourceAssociation("myServiceNetworkAssociation", { ResourceConfigurationId: "myResourceConfigId", ServiceNetworkId: "myServiceNetworkId"});
Advanced Configuration
Section titled “Advanced Configuration”Configure a ServiceNetworkResourceAssociation with tags for better identification and management.
const advancedServiceNetworkAssociation = await AWS.VpcLattice.ServiceNetworkResourceAssociation("advancedServiceNetworkAssociation", { ResourceConfigurationId: "myAdvancedResourceConfigId", ServiceNetworkId: "myAdvancedServiceNetworkId", Tags: [ { Key: "Environment", Value: "Production" }, { Key: "Project", Value: "VpcLatticeIntegration" } ]});
Adopting Existing Resources
Section titled “Adopting Existing Resources”Demonstrate how to adopt an existing resource if it already exists, which prevents errors during deployment.
const adoptedServiceNetworkAssociation = await AWS.VpcLattice.ServiceNetworkResourceAssociation("adoptedServiceNetworkAssociation", { ResourceConfigurationId: "existingResourceConfigId", ServiceNetworkId: "existingServiceNetworkId", adopt: true});
Complete Resource Configuration
Section titled “Complete Resource Configuration”Create a ServiceNetworkResourceAssociation with a full configuration, including optional properties.
const completeServiceNetworkAssociation = await AWS.VpcLattice.ServiceNetworkResourceAssociation("completeServiceNetworkAssociation", { ResourceConfigurationId: "fullResourceConfigId", ServiceNetworkId: "fullServiceNetworkId", Tags: [ { Key: "Environment", Value: "Development" }, { Key: "Owner", Value: "DevTeam" } ], adopt: false // Default value, explicitly set to false});