aws logo
AWS Classic v5.41.0, May 15 23

aws.ram.ResourceAssociation

Explore with Pulumi AI

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

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 = aws_subnet.Example.Arn,
        ResourceShareArn = aws_ram_resource_share.Example.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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(aws_subnet.Example.Arn),
			ResourceShareArn: pulumi.Any(aws_ram_resource_share.Example.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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(aws_subnet.example().arn())
            .resourceShareArn(aws_ram_resource_share.example().arn())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.ram.ResourceAssociation("example",
    resource_arn=aws_subnet["example"]["arn"],
    resource_share_arn=aws_ram_resource_share["example"]["arn"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.ram.ResourceAssociation("example", {
    resourceArn: aws_subnet.example.arn,
    resourceShareArn: aws_ram_resource_share.example.arn,
});
resources:
  example:
    type: aws:ram:ResourceAssociation
    properties:
      resourceArn: ${aws_subnet.example.arn}
      resourceShareArn: ${aws_ram_resource_share.example.arn}

Create ResourceAssociation Resource

new ResourceAssociation(name: string, args: ResourceAssociationArgs, opts?: CustomResourceOptions);
@overload
def ResourceAssociation(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        resource_arn: Optional[str] = None,
                        resource_share_arn: Optional[str] = None)
@overload
def ResourceAssociation(resource_name: str,
                        args: ResourceAssociationArgs,
                        opts: Optional[ResourceOptions] = 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.

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.

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

RAM Resource Associations can be imported using their Resource Share ARN and Resource ARN separated by a comma, e.g.,

 $ 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

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.