v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1473359323.2 KB

Associates a VPC with a service network. When you associate a VPC with the service network, it enables all the resources within that VPC to be clients and communicate with other services in the service network. For more information, see Manage VPC associations in the Amazon VPC Lattice User Guide.

You can't use this operation if there is a disassociation in progress. If the association fails, retry by deleting the association and recreating it.

As a result of this operation, the association gets created in the service network account and the VPC owner account.

If you add a security group to the service network and VPC association, the association must continue to always have at least one security group. You can add or edit security groups at any time. However, to remove all security groups, you must first delete the association and recreate it without security groups.

post/servicenetworkvpcassociations

Request body

clientTokenstring

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.

serviceNetworkIdentifierstring required

The ID or ARN of the service network. You must use an ARN if the resources are in different accounts.

vpcIdentifierstring required

The ID of the VPC.

privateDnsEnabledboolean

Indicates if private DNS is enabled for the VPC association.

securityGroupIdsSecurityGroupId[]

The IDs of the security groups. Security groups aren't added by default. You can add a security group to apply network level controls to control which resources in a VPC are allowed to access the service network and its services. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html">Control traffic to resources using security groups</a> in the <i>Amazon VPC User Guide</i>.

tagsobject

The tags for the association.

Response

Success

idstring

The ID of the association.

status'CREATE_IN_PROGRESS' | 'ACTIVE' | 'UPDATE_IN_PROGRESS' | 'DELETE_IN_PROGRESS' | 'CREATE_FAILED' | 'DELETE_FAILED' | 'UPDATE_FAILED'

The association status.

arnstring

The Amazon Resource Name (ARN) of the association.

createdBystring

The account that created the association.

securityGroupIdsSecurityGroupId[]

The IDs of the security groups.

privateDnsEnabledboolean

Indicates if private DNS is enabled for the VPC association.