1. Packages
  2. AWS Classic
  3. API Docs
  4. ram
  5. ResourceAssociation

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.ram.ResourceAssociation

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Manages a Resource Access Manager (RAM) Resource Association.

    NOTE: Certain AWS resources (e.g., EC2 Subnets) can only be shared in an AWS account that is a member of an AWS Organizations organization with organization-wide Resource Access Manager functionality enabled. See the Resource Access Manager User Guide and AWS service specific documentation for additional information.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ram.ResourceAssociation("example", {
        resourceArn: exampleAwsSubnet.arn,
        resourceShareArn: exampleAwsRamResourceShare.arn,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ram.ResourceAssociation("example",
        resource_arn=example_aws_subnet["arn"],
        resource_share_arn=example_aws_ram_resource_share["arn"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ram"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ram.NewResourceAssociation(ctx, "example", &ram.ResourceAssociationArgs{
    			ResourceArn:      pulumi.Any(exampleAwsSubnet.Arn),
    			ResourceShareArn: pulumi.Any(exampleAwsRamResourceShare.Arn),
    		})
    		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.Ram.ResourceAssociation("example", new()
        {
            ResourceArn = exampleAwsSubnet.Arn,
            ResourceShareArn = exampleAwsRamResourceShare.Arn,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ram.ResourceAssociation;
    import com.pulumi.aws.ram.ResourceAssociationArgs;
    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 ResourceAssociation("example", ResourceAssociationArgs.builder()
                .resourceArn(exampleAwsSubnet.arn())
                .resourceShareArn(exampleAwsRamResourceShare.arn())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ram:ResourceAssociation
        properties:
          resourceArn: ${exampleAwsSubnet.arn}
          resourceShareArn: ${exampleAwsRamResourceShare.arn}
    

    Create ResourceAssociation Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ResourceAssociation(name: string, args: ResourceAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def ResourceAssociation(resource_name: str,
                            args: ResourceAssociationArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def ResourceAssociation(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            resource_arn: Optional[str] = None,
                            resource_share_arn: Optional[str] = None)
    func NewResourceAssociation(ctx *Context, name string, args ResourceAssociationArgs, opts ...ResourceOption) (*ResourceAssociation, error)
    public ResourceAssociation(string name, ResourceAssociationArgs args, CustomResourceOptions? opts = null)
    public ResourceAssociation(String name, ResourceAssociationArgs args)
    public ResourceAssociation(String name, ResourceAssociationArgs args, CustomResourceOptions options)
    
    type: aws:ram:ResourceAssociation
    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 ResourceAssociationArgs
    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 ResourceAssociationArgs
    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 ResourceAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourceAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourceAssociationArgs
    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 resourceAssociationResource = new Aws.Ram.ResourceAssociation("resourceAssociationResource", new()
    {
        ResourceArn = "string",
        ResourceShareArn = "string",
    });
    
    example, err := ram.NewResourceAssociation(ctx, "resourceAssociationResource", &ram.ResourceAssociationArgs{
    	ResourceArn:      pulumi.String("string"),
    	ResourceShareArn: pulumi.String("string"),
    })
    
    var resourceAssociationResource = new ResourceAssociation("resourceAssociationResource", ResourceAssociationArgs.builder()
        .resourceArn("string")
        .resourceShareArn("string")
        .build());
    
    resource_association_resource = aws.ram.ResourceAssociation("resourceAssociationResource",
        resource_arn="string",
        resource_share_arn="string")
    
    const resourceAssociationResource = new aws.ram.ResourceAssociation("resourceAssociationResource", {
        resourceArn: "string",
        resourceShareArn: "string",
    });
    
    type: aws:ram:ResourceAssociation
    properties:
        resourceArn: string
        resourceShareArn: string
    

    ResourceAssociation Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ResourceAssociation resource accepts the following input properties:

    ResourceArn string
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    ResourceShareArn string
    Amazon Resource Name (ARN) of the RAM Resource Share.
    ResourceArn string
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    ResourceShareArn string
    Amazon Resource Name (ARN) of the RAM Resource Share.
    resourceArn String
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    resourceShareArn String
    Amazon Resource Name (ARN) of the RAM Resource Share.
    resourceArn string
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    resourceShareArn string
    Amazon Resource Name (ARN) of the RAM Resource Share.
    resource_arn str
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    resource_share_arn str
    Amazon Resource Name (ARN) of the RAM Resource Share.
    resourceArn String
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    resourceShareArn String
    Amazon Resource Name (ARN) of the RAM Resource Share.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ResourceAssociation resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ResourceAssociation Resource

    Get an existing ResourceAssociation 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?: ResourceAssociationState, opts?: CustomResourceOptions): ResourceAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            resource_arn: Optional[str] = None,
            resource_share_arn: Optional[str] = None) -> ResourceAssociation
    func GetResourceAssociation(ctx *Context, name string, id IDInput, state *ResourceAssociationState, opts ...ResourceOption) (*ResourceAssociation, error)
    public static ResourceAssociation Get(string name, Input<string> id, ResourceAssociationState? state, CustomResourceOptions? opts = null)
    public static ResourceAssociation get(String name, Output<String> id, ResourceAssociationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    ResourceArn string
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    ResourceShareArn string
    Amazon Resource Name (ARN) of the RAM Resource Share.
    ResourceArn string
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    ResourceShareArn string
    Amazon Resource Name (ARN) of the RAM Resource Share.
    resourceArn String
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    resourceShareArn String
    Amazon Resource Name (ARN) of the RAM Resource Share.
    resourceArn string
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    resourceShareArn string
    Amazon Resource Name (ARN) of the RAM Resource Share.
    resource_arn str
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    resource_share_arn str
    Amazon Resource Name (ARN) of the RAM Resource Share.
    resourceArn String
    Amazon Resource Name (ARN) of the resource to associate with the RAM Resource Share.
    resourceShareArn String
    Amazon Resource Name (ARN) of the RAM Resource Share.

    Import

    Using pulumi import, import RAM Resource Associations using their Resource Share ARN and Resource ARN separated by a comma. For example:

    $ pulumi import aws:ram/resourceAssociation:ResourceAssociation example arn:aws:ram:eu-west-1:123456789012:resource-share/73da1ab9-b94a-4ba3-8eb4-45917f7f4b12,arn:aws:ec2:eu-west-1:123456789012:subnet/subnet-12345678
    

    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 aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi