Skip to main content

cross_account_attachments

Creates, updates, deletes, gets or lists a cross_account_attachments resource.

Overview

Namecross_account_attachments
TypeResource
Idaws.globalaccelerator.cross_account_attachments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
attachment_arnstringThe Amazon Resource Name (ARN) of the cross-account attachment.
created_timestring (date-time)The date and time that the cross-account attachment was created.
last_modified_timestring (date-time)The date and time that the cross-account attachment was last modified.
namestringThe name of the cross-account attachment. (pattern: <code>[\S\s]+</code>)
principalsarrayThe principals included in the cross-account attachment.
resourcesarrayThe resources included in the cross-account attachment.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_cross_account_attachmentselectregionGets configuration information about a cross-account attachment.
list_cross_account_attachmentsselectregionList the cross-account attachments that have been created in Global Accelerator.
create_cross_account_attachmentinsertregion, IdempotencyTokenCreate 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_attachmentupdateregion, AttachmentArnUpdate 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_attachmentdeleteregionDelete 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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 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
;