service_network_vpc_associations
Creates, updates, deletes, gets or lists a service_network_vpc_associations resource.
Overview
| Name | service_network_vpc_associations |
| Type | Resource |
| Id | aws.vpc_lattice.service_network_vpc_associations |
Fields
The following fields are returned by SELECT queries:
- get_service_network_vpc_association
- list_service_network_vpc_associations
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the association. (pattern: <code>snva-[0-9a-z]{17}</code>) |
arn | string | The Amazon Resource Name (ARN) of the association. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:servicenetworkvpcassociation/snva-[0-9a-z]{17}</code>) |
created_at | string (date-time) | The date and time that the association was created, in ISO-8601 format. |
created_by | string | The account that created the association. (pattern: <code>[0-9]{12}</code>) |
dns_options | object | The DNS configuration options. |
failure_code | string | The failure code. |
failure_message | string | The failure message. |
last_updated_at | string (date-time) | The date and time that the association was last updated, in ISO-8601 format. |
private_dns_enabled | boolean | Indicates if private DNS is enabled in the VPC association. |
security_group_ids | array | The IDs of the security groups. |
service_network_arn | string | The Amazon Resource Name (ARN) of the service network. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:servicenetwork/sn-[0-9a-z]{17}</code>) |
service_network_id | string | The ID of the service network. (pattern: <code>sn-[0-9a-z]{17}</code>) |
service_network_name | string | The name of the service network. (pattern: <code>(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>) |
status | string | The status of the association. (CREATE_IN_PROGRESS, ACTIVE, UPDATE_IN_PROGRESS, DELETE_IN_PROGRESS, CREATE_FAILED, DELETE_FAILED, UPDATE_FAILED) |
vpc_id | string | The ID of the VPC. (pattern: <code>vpc-(([0-9a-z]{8})|([0-9a-z]{17}))</code>) |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the association. (pattern: <code>snva-[0-9a-z]{17}</code>) |
arn | string | The Amazon Resource Name (ARN) of the association. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:servicenetworkvpcassociation/snva-[0-9a-z]{17}</code>) |
created_at | string (date-time) | The date and time that the association was created, in ISO-8601 format. |
created_by | string | The account that created the association. (pattern: <code>[0-9]{12}</code>) |
dns_options | object | The DNS configuration options. |
last_updated_at | string (date-time) | The date and time that the association was last updated, in ISO-8601 format. |
private_dns_enabled | boolean | Indicates if private DNS is enabled for the service network VPC association. |
service_network_arn | string | The Amazon Resource Name (ARN) of the service network. (pattern: <code>arn:[a-z0-9-]+:vpc-lattice:[a-zA-Z0-9-]+:\d{12}:servicenetwork/sn-[0-9a-z]{17}</code>) |
service_network_id | string | The ID of the service network. (pattern: <code>sn-[0-9a-z]{17}</code>) |
service_network_name | string | The name of the service network. (pattern: <code>(?![-])(?!.[-]$)(?!.[-]{2})[a-z0-9-]+</code>) |
status | string | The status. (CREATE_IN_PROGRESS, ACTIVE, UPDATE_IN_PROGRESS, DELETE_IN_PROGRESS, CREATE_FAILED, DELETE_FAILED, UPDATE_FAILED) |
vpc_id | string | The ID of the VPC. (pattern: <code>vpc-(([0-9a-z]{8})|([0-9a-z]{17}))</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_service_network_vpc_association | select | service_network_vpc_association_identifier, region | Retrieves information about the specified association between a service network and a VPC. | |
list_service_network_vpc_associations | select | region | serviceNetworkIdentifier, vpcIdentifier, maxResults, nextToken | Lists the associations between a service network and a VPC. You can filter the list either by VPC or service network. You must provide either the ID of the service network identifier or the ID of the VPC. |
create_service_network_vpc_association | insert | region, serviceNetworkIdentifier, vpcIdentifier | 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. | |
update_service_network_vpc_association | update | service_network_vpc_association_identifier, region | Updates the service network and VPC association. If you add a security group to the service network and VPC association, the association must continue to 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 then recreate it without security groups. | |
delete_service_network_vpc_association | delete | service_network_vpc_association_identifier, region | Disassociates the VPC from the service network. You can't disassociate the VPC if there is a create or update association in progress. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
service_network_vpc_association_identifier | string | The ID or ARN of the association. |
maxResults | integer | The maximum number of results to return. |
nextToken | string | A pagination token for the next page of results. |
serviceNetworkIdentifier | string | The ID or ARN of the service network. |
vpcIdentifier | string | The ID or ARN of the VPC. |
SELECT examples
- get_service_network_vpc_association
- list_service_network_vpc_associations
Retrieves information about the specified association between a service network and a VPC.
SELECT
id,
arn,
created_at,
created_by,
dns_options,
failure_code,
failure_message,
last_updated_at,
private_dns_enabled,
security_group_ids,
service_network_arn,
service_network_id,
service_network_name,
status,
vpc_id
FROM aws.vpc_lattice.service_network_vpc_associations
WHERE service_network_vpc_association_identifier = '{{ service_network_vpc_association_identifier }}' -- required
AND region = '{{ region }}' -- required
;
Lists the associations between a service network and a VPC. You can filter the list either by VPC or service network. You must provide either the ID of the service network identifier or the ID of the VPC.
SELECT
id,
arn,
created_at,
created_by,
dns_options,
last_updated_at,
private_dns_enabled,
service_network_arn,
service_network_id,
service_network_name,
status,
vpc_id
FROM aws.vpc_lattice.service_network_vpc_associations
WHERE region = '{{ region }}' -- required
AND serviceNetworkIdentifier = '{{ serviceNetworkIdentifier }}'
AND vpcIdentifier = '{{ vpcIdentifier }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_service_network_vpc_association
- Manifest
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.
INSERT INTO aws.vpc_lattice.service_network_vpc_associations (
clientToken,
serviceNetworkIdentifier,
vpcIdentifier,
privateDnsEnabled,
securityGroupIds,
tags,
dnsOptions,
region
)
SELECT
'{{ clientToken }}',
'{{ serviceNetworkIdentifier }}' /* required */,
'{{ vpcIdentifier }}' /* required */,
{{ privateDnsEnabled }},
'{{ securityGroupIds }}',
'{{ tags }}',
'{{ dnsOptions }}',
'{{ region }}'
RETURNING
id,
arn,
created_by,
dns_options,
private_dns_enabled,
security_group_ids,
status
;
# Description fields are for documentation purposes
- name: service_network_vpc_associations
props:
- name: region
value: "{{ region }}"
description: Required parameter for the service_network_vpc_associations resource.
- name: clientToken
value: "{{ clientToken }}"
- name: serviceNetworkIdentifier
value: "{{ serviceNetworkIdentifier }}"
- name: vpcIdentifier
value: "{{ vpcIdentifier }}"
- name: privateDnsEnabled
value: {{ privateDnsEnabled }}
- name: securityGroupIds
value:
- "{{ securityGroupIds }}"
- name: tags
value: "{{ tags }}"
- name: dnsOptions
description: |
The DNS configuration options.
value:
privateDnsPreference: "{{ privateDnsPreference }}"
privateDnsSpecifiedDomains:
- "{{ privateDnsSpecifiedDomains }}"
UPDATE examples
- update_service_network_vpc_association
Updates the service network and VPC association. If you add a security group to the service network and VPC association, the association must continue to 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 then recreate it without security groups.
UPDATE aws.vpc_lattice.service_network_vpc_associations
SET
securityGroupIds = '{{ securityGroupIds }}',
privateDnsEnabled = {{ privateDnsEnabled }},
dnsOptions = '{{ dnsOptions }}'
WHERE
service_network_vpc_association_identifier = '{{ service_network_vpc_association_identifier }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
arn,
created_by,
dns_options,
private_dns_enabled,
security_group_ids,
status;
DELETE examples
- delete_service_network_vpc_association
Disassociates the VPC from the service network. You can't disassociate the VPC if there is a create or update association in progress.
DELETE FROM aws.vpc_lattice.service_network_vpc_associations
WHERE service_network_vpc_association_identifier = '{{ service_network_vpc_association_identifier }}' --required
AND region = '{{ region }}' --required
;