aws.globalaccelerator.CrossAccountAttachment
Explore with Pulumi AI
Resource for managing an AWS Global Accelerator Cross Account Attachment.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.globalaccelerator.CrossAccountAttachment("example", {name: "example-cross-account-attachment"});
import pulumi
import pulumi_aws as aws
example = aws.globalaccelerator.CrossAccountAttachment("example", name="example-cross-account-attachment")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/globalaccelerator"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := globalaccelerator.NewCrossAccountAttachment(ctx, "example", &globalaccelerator.CrossAccountAttachmentArgs{
			Name: pulumi.String("example-cross-account-attachment"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.GlobalAccelerator.CrossAccountAttachment("example", new()
    {
        Name = "example-cross-account-attachment",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.globalaccelerator.CrossAccountAttachment;
import com.pulumi.aws.globalaccelerator.CrossAccountAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new CrossAccountAttachment("example", CrossAccountAttachmentArgs.builder()
            .name("example-cross-account-attachment")
            .build());
    }
}
resources:
  example:
    type: aws:globalaccelerator:CrossAccountAttachment
    properties:
      name: example-cross-account-attachment
Usage with Optional Arguments
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.globalaccelerator.CrossAccountAttachment("example", {
    name: "example-cross-account-attachment",
    principals: ["123456789012"],
    resources: [{
        endpointId: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
        region: "us-west-2",
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.globalaccelerator.CrossAccountAttachment("example",
    name="example-cross-account-attachment",
    principals=["123456789012"],
    resources=[{
        "endpoint_id": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
        "region": "us-west-2",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/globalaccelerator"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := globalaccelerator.NewCrossAccountAttachment(ctx, "example", &globalaccelerator.CrossAccountAttachmentArgs{
			Name: pulumi.String("example-cross-account-attachment"),
			Principals: pulumi.StringArray{
				pulumi.String("123456789012"),
			},
			Resources: globalaccelerator.CrossAccountAttachmentResourceArray{
				&globalaccelerator.CrossAccountAttachmentResourceArgs{
					EndpointId: pulumi.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"),
					Region:     pulumi.String("us-west-2"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.GlobalAccelerator.CrossAccountAttachment("example", new()
    {
        Name = "example-cross-account-attachment",
        Principals = new[]
        {
            "123456789012",
        },
        Resources = new[]
        {
            new Aws.GlobalAccelerator.Inputs.CrossAccountAttachmentResourceArgs
            {
                EndpointId = "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188",
                Region = "us-west-2",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.globalaccelerator.CrossAccountAttachment;
import com.pulumi.aws.globalaccelerator.CrossAccountAttachmentArgs;
import com.pulumi.aws.globalaccelerator.inputs.CrossAccountAttachmentResourceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new CrossAccountAttachment("example", CrossAccountAttachmentArgs.builder()
            .name("example-cross-account-attachment")
            .principals("123456789012")
            .resources(CrossAccountAttachmentResourceArgs.builder()
                .endpointId("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188")
                .region("us-west-2")
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:globalaccelerator:CrossAccountAttachment
    properties:
      name: example-cross-account-attachment
      principals:
        - '123456789012'
      resources:
        - endpointId: arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188
          region: us-west-2
Create CrossAccountAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CrossAccountAttachment(name: string, args?: CrossAccountAttachmentArgs, opts?: CustomResourceOptions);@overload
def CrossAccountAttachment(resource_name: str,
                           args: Optional[CrossAccountAttachmentArgs] = None,
                           opts: Optional[ResourceOptions] = None)
@overload
def CrossAccountAttachment(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           name: Optional[str] = None,
                           principals: Optional[Sequence[str]] = None,
                           resources: Optional[Sequence[CrossAccountAttachmentResourceArgs]] = None,
                           tags: Optional[Mapping[str, str]] = None)func NewCrossAccountAttachment(ctx *Context, name string, args *CrossAccountAttachmentArgs, opts ...ResourceOption) (*CrossAccountAttachment, error)public CrossAccountAttachment(string name, CrossAccountAttachmentArgs? args = null, CustomResourceOptions? opts = null)
public CrossAccountAttachment(String name, CrossAccountAttachmentArgs args)
public CrossAccountAttachment(String name, CrossAccountAttachmentArgs args, CustomResourceOptions options)
type: aws:globalaccelerator:CrossAccountAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CrossAccountAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CrossAccountAttachmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CrossAccountAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CrossAccountAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CrossAccountAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var crossAccountAttachmentResource = new Aws.GlobalAccelerator.CrossAccountAttachment("crossAccountAttachmentResource", new()
{
    Name = "string",
    Principals = new[]
    {
        "string",
    },
    Resources = new[]
    {
        new Aws.GlobalAccelerator.Inputs.CrossAccountAttachmentResourceArgs
        {
            CidrBlock = "string",
            EndpointId = "string",
            Region = "string",
        },
    },
    Tags = 
    {
        { "string", "string" },
    },
});
example, err := globalaccelerator.NewCrossAccountAttachment(ctx, "crossAccountAttachmentResource", &globalaccelerator.CrossAccountAttachmentArgs{
	Name: pulumi.String("string"),
	Principals: pulumi.StringArray{
		pulumi.String("string"),
	},
	Resources: globalaccelerator.CrossAccountAttachmentResourceArray{
		&globalaccelerator.CrossAccountAttachmentResourceArgs{
			CidrBlock:  pulumi.String("string"),
			EndpointId: pulumi.String("string"),
			Region:     pulumi.String("string"),
		},
	},
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
var crossAccountAttachmentResource = new CrossAccountAttachment("crossAccountAttachmentResource", CrossAccountAttachmentArgs.builder()
    .name("string")
    .principals("string")
    .resources(CrossAccountAttachmentResourceArgs.builder()
        .cidrBlock("string")
        .endpointId("string")
        .region("string")
        .build())
    .tags(Map.of("string", "string"))
    .build());
cross_account_attachment_resource = aws.globalaccelerator.CrossAccountAttachment("crossAccountAttachmentResource",
    name="string",
    principals=["string"],
    resources=[{
        "cidr_block": "string",
        "endpoint_id": "string",
        "region": "string",
    }],
    tags={
        "string": "string",
    })
const crossAccountAttachmentResource = new aws.globalaccelerator.CrossAccountAttachment("crossAccountAttachmentResource", {
    name: "string",
    principals: ["string"],
    resources: [{
        cidrBlock: "string",
        endpointId: "string",
        region: "string",
    }],
    tags: {
        string: "string",
    },
});
type: aws:globalaccelerator:CrossAccountAttachment
properties:
    name: string
    principals:
        - string
    resources:
        - cidrBlock: string
          endpointId: string
          region: string
    tags:
        string: string
CrossAccountAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CrossAccountAttachment resource accepts the following input properties:
- Name string
- Name of the Cross Account Attachment. - The following arguments are optional: 
- Principals List<string>
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- Resources
List<CrossAccount Attachment Resource> 
- List of resources to be associated with the accelerator.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Name string
- Name of the Cross Account Attachment. - The following arguments are optional: 
- Principals []string
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- Resources
[]CrossAccount Attachment Resource Args 
- List of resources to be associated with the accelerator.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- name String
- Name of the Cross Account Attachment. - The following arguments are optional: 
- principals List<String>
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- resources
List<CrossAccount Attachment Resource> 
- List of resources to be associated with the accelerator.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- name string
- Name of the Cross Account Attachment. - The following arguments are optional: 
- principals string[]
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- resources
CrossAccount Attachment Resource[] 
- List of resources to be associated with the accelerator.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- name str
- Name of the Cross Account Attachment. - The following arguments are optional: 
- principals Sequence[str]
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- resources
Sequence[CrossAccount Attachment Resource Args] 
- List of resources to be associated with the accelerator.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- name String
- Name of the Cross Account Attachment. - The following arguments are optional: 
- principals List<String>
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- resources List<Property Map>
- List of resources to be associated with the accelerator.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the CrossAccountAttachment resource produces the following output properties:
- Arn string
- ARN of the Cross Account Attachment.
- CreatedTime string
- Creation Time when the Cross Account Attachment.
- Id string
- The provider-assigned unique ID for this managed resource.
- LastModified stringTime 
- Last modified time of the Cross Account Attachment.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Arn string
- ARN of the Cross Account Attachment.
- CreatedTime string
- Creation Time when the Cross Account Attachment.
- Id string
- The provider-assigned unique ID for this managed resource.
- LastModified stringTime 
- Last modified time of the Cross Account Attachment.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn String
- ARN of the Cross Account Attachment.
- createdTime String
- Creation Time when the Cross Account Attachment.
- id String
- The provider-assigned unique ID for this managed resource.
- lastModified StringTime 
- Last modified time of the Cross Account Attachment.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn string
- ARN of the Cross Account Attachment.
- createdTime string
- Creation Time when the Cross Account Attachment.
- id string
- The provider-assigned unique ID for this managed resource.
- lastModified stringTime 
- Last modified time of the Cross Account Attachment.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn str
- ARN of the Cross Account Attachment.
- created_time str
- Creation Time when the Cross Account Attachment.
- id str
- The provider-assigned unique ID for this managed resource.
- last_modified_ strtime 
- Last modified time of the Cross Account Attachment.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn String
- ARN of the Cross Account Attachment.
- createdTime String
- Creation Time when the Cross Account Attachment.
- id String
- The provider-assigned unique ID for this managed resource.
- lastModified StringTime 
- Last modified time of the Cross Account Attachment.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
Look up Existing CrossAccountAttachment Resource
Get an existing CrossAccountAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CrossAccountAttachmentState, opts?: CustomResourceOptions): CrossAccountAttachment@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        created_time: Optional[str] = None,
        last_modified_time: Optional[str] = None,
        name: Optional[str] = None,
        principals: Optional[Sequence[str]] = None,
        resources: Optional[Sequence[CrossAccountAttachmentResourceArgs]] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> CrossAccountAttachmentfunc GetCrossAccountAttachment(ctx *Context, name string, id IDInput, state *CrossAccountAttachmentState, opts ...ResourceOption) (*CrossAccountAttachment, error)public static CrossAccountAttachment Get(string name, Input<string> id, CrossAccountAttachmentState? state, CustomResourceOptions? opts = null)public static CrossAccountAttachment get(String name, Output<String> id, CrossAccountAttachmentState state, CustomResourceOptions options)resources:  _:    type: aws:globalaccelerator:CrossAccountAttachment    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- ARN of the Cross Account Attachment.
- CreatedTime string
- Creation Time when the Cross Account Attachment.
- LastModified stringTime 
- Last modified time of the Cross Account Attachment.
- Name string
- Name of the Cross Account Attachment. - The following arguments are optional: 
- Principals List<string>
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- Resources
List<CrossAccount Attachment Resource> 
- List of resources to be associated with the accelerator.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Arn string
- ARN of the Cross Account Attachment.
- CreatedTime string
- Creation Time when the Cross Account Attachment.
- LastModified stringTime 
- Last modified time of the Cross Account Attachment.
- Name string
- Name of the Cross Account Attachment. - The following arguments are optional: 
- Principals []string
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- Resources
[]CrossAccount Attachment Resource Args 
- List of resources to be associated with the accelerator.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn String
- ARN of the Cross Account Attachment.
- createdTime String
- Creation Time when the Cross Account Attachment.
- lastModified StringTime 
- Last modified time of the Cross Account Attachment.
- name String
- Name of the Cross Account Attachment. - The following arguments are optional: 
- principals List<String>
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- resources
List<CrossAccount Attachment Resource> 
- List of resources to be associated with the accelerator.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn string
- ARN of the Cross Account Attachment.
- createdTime string
- Creation Time when the Cross Account Attachment.
- lastModified stringTime 
- Last modified time of the Cross Account Attachment.
- name string
- Name of the Cross Account Attachment. - The following arguments are optional: 
- principals string[]
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- resources
CrossAccount Attachment Resource[] 
- List of resources to be associated with the accelerator.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn str
- ARN of the Cross Account Attachment.
- created_time str
- Creation Time when the Cross Account Attachment.
- last_modified_ strtime 
- Last modified time of the Cross Account Attachment.
- name str
- Name of the Cross Account Attachment. - The following arguments are optional: 
- principals Sequence[str]
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- resources
Sequence[CrossAccount Attachment Resource Args] 
- List of resources to be associated with the accelerator.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn String
- ARN of the Cross Account Attachment.
- createdTime String
- Creation Time when the Cross Account Attachment.
- lastModified StringTime 
- Last modified time of the Cross Account Attachment.
- name String
- Name of the Cross Account Attachment. - The following arguments are optional: 
- principals List<String>
- List of AWS account IDs that are allowed to associate resources with the accelerator.
- resources List<Property Map>
- List of resources to be associated with the accelerator.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
Supporting Types
CrossAccountAttachmentResource, CrossAccountAttachmentResourceArgs        
- CidrBlock string
- IP address range, in CIDR format, that is specified as resource.
- EndpointId string
- The endpoint ID for the endpoint that is specified as a AWS resource.
- Region string
- The AWS Region where a shared endpoint resource is located.
- CidrBlock string
- IP address range, in CIDR format, that is specified as resource.
- EndpointId string
- The endpoint ID for the endpoint that is specified as a AWS resource.
- Region string
- The AWS Region where a shared endpoint resource is located.
- cidrBlock String
- IP address range, in CIDR format, that is specified as resource.
- endpointId String
- The endpoint ID for the endpoint that is specified as a AWS resource.
- region String
- The AWS Region where a shared endpoint resource is located.
- cidrBlock string
- IP address range, in CIDR format, that is specified as resource.
- endpointId string
- The endpoint ID for the endpoint that is specified as a AWS resource.
- region string
- The AWS Region where a shared endpoint resource is located.
- cidr_block str
- IP address range, in CIDR format, that is specified as resource.
- endpoint_id str
- The endpoint ID for the endpoint that is specified as a AWS resource.
- region str
- The AWS Region where a shared endpoint resource is located.
- cidrBlock String
- IP address range, in CIDR format, that is specified as resource.
- endpointId String
- The endpoint ID for the endpoint that is specified as a AWS resource.
- region String
- The AWS Region where a shared endpoint resource is located.
Import
Using pulumi import, import Global Accelerator Cross Account Attachment using the example_id_arg. For example:
$ pulumi import aws:globalaccelerator/crossAccountAttachment:CrossAccountAttachment example arn:aws:globalaccelerator::012345678910:attachment/01234567-abcd-8910-efgh-123456789012
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.