cross_account_attachments
Creates, updates, deletes, gets or lists a cross_account_attachments resource.
Overview
| Name | cross_account_attachments |
| Type | Resource |
| Id | aws.globalaccelerator.cross_account_attachments |
Fields
The following fields are returned by SELECT queries:
- describe_cross_account_attachment
- list_cross_account_attachments
| Name | Datatype | Description |
|---|---|---|
attachment_arn | string | The Amazon Resource Name (ARN) of the cross-account attachment. |
created_time | string (date-time) | The date and time that the cross-account attachment was created. |
last_modified_time | string (date-time) | The date and time that the cross-account attachment was last modified. |
name | string | The name of the cross-account attachment. (pattern: <code>[\S\s]+</code>) |
principals | array | The principals included in the cross-account attachment. |
resources | array | The resources included in the cross-account attachment. |
| Name | Datatype | Description |
|---|---|---|
attachment_arn | string | The Amazon Resource Name (ARN) of the cross-account attachment. |
created_time | string (date-time) | The date and time that the cross-account attachment was created. |
last_modified_time | string (date-time) | The date and time that the cross-account attachment was last modified. |
name | string | The name of the cross-account attachment. (pattern: <code>[\S\s]+</code>) |
principals | array | The principals included in the cross-account attachment. |
resources | array | The resources included in the cross-account attachment. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_cross_account_attachment | select | region | Gets configuration information about a cross-account attachment. | |
list_cross_account_attachments | select | region | List the cross-account attachments that have been created in Global Accelerator. | |
create_cross_account_attachment | insert | region, IdempotencyToken | Create a cross-account attachment in Global Accelerator. You create a cross-account attachment to specify the principals who have permission to work with resources in accelerators in their own account. You specify, in the same attachment, the resources that are shared. A principal can be an Amazon Web Services account number or the Amazon Resource Name (ARN) for an accelerator. For account numbers that are listed as principals, to work with a resource listed in the attachment, you must sign in to an account specified as a principal. Then, you can work with resources that are listed, with any of your accelerators. If an accelerator ARN is listed in the cross-account attachment as a principal, anyone with permission to make updates to the accelerator can work with resources that are listed in the attachment. Specify each principal and resource separately. To specify two CIDR address pools, list them individually under Resources, and so on. For a command line operation, for example, you might use a statement like the following: "Resources": [{"Cidr": "169.254.60.0/24"},{"Cidr": "169.254.59.0/24"}] For more information, see Working with cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer Guide. | |
update_cross_account_attachment | update | region, AttachmentArn | Update a cross-account attachment to add or remove principals or resources. When you update an attachment to remove a principal (account ID or accelerator) or a resource, Global Accelerator revokes the permission for specific resources. For more information, see Working with cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer Guide. | |
delete_cross_account_attachment | delete | region | Delete a cross-account attachment. When you delete an attachment, Global Accelerator revokes the permission to use the resources in the attachment from all principals in the list of principals. Global Accelerator revokes the permission for specific resources. For more information, see Working with cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer Guide. |
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) |
SELECT examples
- describe_cross_account_attachment
- list_cross_account_attachments
Gets configuration information about a cross-account attachment.
SELECT
attachment_arn,
created_time,
last_modified_time,
name,
principals,
resources
FROM aws.globalaccelerator.cross_account_attachments
WHERE region = '{{ region }}' -- required
;
List the cross-account attachments that have been created in Global Accelerator.
SELECT
attachment_arn,
created_time,
last_modified_time,
name,
principals,
resources
FROM aws.globalaccelerator.cross_account_attachments
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_cross_account_attachment
- Manifest
Create a cross-account attachment in Global Accelerator. You create a cross-account attachment to specify the principals who have permission to work with resources in accelerators in their own account. You specify, in the same attachment, the resources that are shared. A principal can be an Amazon Web Services account number or the Amazon Resource Name (ARN) for an accelerator. For account numbers that are listed as principals, to work with a resource listed in the attachment, you must sign in to an account specified as a principal. Then, you can work with resources that are listed, with any of your accelerators. If an accelerator ARN is listed in the cross-account attachment as a principal, anyone with permission to make updates to the accelerator can work with resources that are listed in the attachment. Specify each principal and resource separately. To specify two CIDR address pools, list them individually under Resources, and so on. For a command line operation, for example, you might use a statement like the following: "Resources": [{"Cidr": "169.254.60.0/24"},{"Cidr": "169.254.59.0/24"}] For more information, see Working with cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer Guide.
INSERT INTO aws.globalaccelerator.cross_account_attachments (
Name,
Principals,
Resources,
IdempotencyToken,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ Principals }}',
'{{ Resources }}',
'{{ IdempotencyToken }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
cross_account_attachment
;
# Description fields are for documentation purposes
- name: cross_account_attachments
props:
- name: region
value: "{{ region }}"
description: Required parameter for the cross_account_attachments resource.
- name: Name
value: "{{ Name }}"
description: |
The name of the cross-account attachment.
- name: Principals
value:
- "{{ Principals }}"
description: |
The principals to include in the cross-account attachment. A principal can be an Amazon Web Services account number or the Amazon Resource Name (ARN) for an accelerator.
- name: Resources
description: |
The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource can be any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring your own IP address (BYOIP) address pool.
value:
- EndpointId: "{{ EndpointId }}"
Cidr: "{{ Cidr }}"
Region: "{{ Region }}"
- name: IdempotencyToken
value: "{{ IdempotencyToken }}"
description: |
A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.
- name: Tags
description: |
Add tags for a cross-account attachment. For more information, see Tagging in Global Accelerator in the Global Accelerator Developer Guide.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_cross_account_attachment
Update a cross-account attachment to add or remove principals or resources. When you update an attachment to remove a principal (account ID or accelerator) or a resource, Global Accelerator revokes the permission for specific resources. For more information, see Working with cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer Guide.
UPDATE aws.globalaccelerator.cross_account_attachments
SET
AttachmentArn = '{{ AttachmentArn }}',
Name = '{{ Name }}',
AddPrincipals = '{{ AddPrincipals }}',
RemovePrincipals = '{{ RemovePrincipals }}',
AddResources = '{{ AddResources }}',
RemoveResources = '{{ RemoveResources }}'
WHERE
region = '{{ region }}' --required
AND AttachmentArn = '{{ AttachmentArn }}' --required
RETURNING
cross_account_attachment;
DELETE examples
- delete_cross_account_attachment
Delete a cross-account attachment. When you delete an attachment, Global Accelerator revokes the permission to use the resources in the attachment from all principals in the list of principals. Global Accelerator revokes the permission for specific resources. For more information, see Working with cross-account attachments and resources in Global Accelerator in the Global Accelerator Developer Guide.
DELETE FROM aws.globalaccelerator.cross_account_attachments
WHERE region = '{{ region }}' --required
;