1. Packages
  2. AWS Classic
  3. API Docs
  4. resourcegroups
  5. Resource

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

AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi

aws.resourcegroups.Resource

Explore with Pulumi AI

aws logo

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

AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi

    Resource for managing an AWS Resource Groups Resource.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.DedicatedHost("example", {
        instanceFamily: "t3",
        availabilityZone: "us-east-1a",
        hostRecovery: "off",
        autoPlacement: "on",
    });
    const exampleGroup = new aws.resourcegroups.Group("example", {name: "example"});
    const exampleResource = new aws.resourcegroups.Resource("example", {
        groupArn: exampleGroup.arn,
        resourceArn: example.arn,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.DedicatedHost("example",
        instance_family="t3",
        availability_zone="us-east-1a",
        host_recovery="off",
        auto_placement="on")
    example_group = aws.resourcegroups.Group("example", name="example")
    example_resource = aws.resourcegroups.Resource("example",
        group_arn=example_group.arn,
        resource_arn=example.arn)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/resourcegroups"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ec2.NewDedicatedHost(ctx, "example", &ec2.DedicatedHostArgs{
    			InstanceFamily:   pulumi.String("t3"),
    			AvailabilityZone: pulumi.String("us-east-1a"),
    			HostRecovery:     pulumi.String("off"),
    			AutoPlacement:    pulumi.String("on"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleGroup, err := resourcegroups.NewGroup(ctx, "example", &resourcegroups.GroupArgs{
    			Name: pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = resourcegroups.NewResource(ctx, "example", &resourcegroups.ResourceArgs{
    			GroupArn:    exampleGroup.Arn,
    			ResourceArn: example.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.Ec2.DedicatedHost("example", new()
        {
            InstanceFamily = "t3",
            AvailabilityZone = "us-east-1a",
            HostRecovery = "off",
            AutoPlacement = "on",
        });
    
        var exampleGroup = new Aws.ResourceGroups.Group("example", new()
        {
            Name = "example",
        });
    
        var exampleResource = new Aws.ResourceGroups.Resource("example", new()
        {
            GroupArn = exampleGroup.Arn,
            ResourceArn = example.Arn,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.DedicatedHost;
    import com.pulumi.aws.ec2.DedicatedHostArgs;
    import com.pulumi.aws.resourcegroups.Group;
    import com.pulumi.aws.resourcegroups.GroupArgs;
    import com.pulumi.aws.resourcegroups.Resource;
    import com.pulumi.aws.resourcegroups.ResourceArgs;
    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 DedicatedHost("example", DedicatedHostArgs.builder()        
                .instanceFamily("t3")
                .availabilityZone("us-east-1a")
                .hostRecovery("off")
                .autoPlacement("on")
                .build());
    
            var exampleGroup = new Group("exampleGroup", GroupArgs.builder()        
                .name("example")
                .build());
    
            var exampleResource = new Resource("exampleResource", ResourceArgs.builder()        
                .groupArn(exampleGroup.arn())
                .resourceArn(example.arn())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2:DedicatedHost
        properties:
          instanceFamily: t3
          availabilityZone: us-east-1a
          hostRecovery: off
          autoPlacement: on
      exampleGroup:
        type: aws:resourcegroups:Group
        name: example
        properties:
          name: example
      exampleResource:
        type: aws:resourcegroups:Resource
        name: example
        properties:
          groupArn: ${exampleGroup.arn}
          resourceArn: ${example.arn}
    

    Create Resource Resource

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

    Constructor syntax

    new Resource(name: string, args: ResourceArgs, opts?: CustomResourceOptions);
    @overload
    def Resource(resource_name: str,
                 args: ResourceArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Resource(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 group_arn: Optional[str] = None,
                 resource_arn: Optional[str] = None)
    func NewResource(ctx *Context, name string, args ResourceArgs, opts ...ResourceOption) (*Resource, error)
    public Resource(string name, ResourceArgs args, CustomResourceOptions? opts = null)
    public Resource(String name, ResourceArgs args)
    public Resource(String name, ResourceArgs args, CustomResourceOptions options)
    
    type: aws:resourcegroups:Resource
    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 ResourceArgs
    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 ResourceArgs
    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 ResourceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var exampleresourceResourceResourceFromResourcegroupsresource = new Aws.ResourceGroups.Resource("exampleresourceResourceResourceFromResourcegroupsresource", new()
    {
        GroupArn = "string",
        ResourceArn = "string",
    });
    
    example, err := resourcegroups.NewResource(ctx, "exampleresourceResourceResourceFromResourcegroupsresource", &resourcegroups.ResourceArgs{
    	GroupArn:    pulumi.String("string"),
    	ResourceArn: pulumi.String("string"),
    })
    
    var exampleresourceResourceResourceFromResourcegroupsresource = new Resource("exampleresourceResourceResourceFromResourcegroupsresource", ResourceArgs.builder()        
        .groupArn("string")
        .resourceArn("string")
        .build());
    
    exampleresource_resource_resource_from_resourcegroupsresource = aws.resourcegroups.Resource("exampleresourceResourceResourceFromResourcegroupsresource",
        group_arn="string",
        resource_arn="string")
    
    const exampleresourceResourceResourceFromResourcegroupsresource = new aws.resourcegroups.Resource("exampleresourceResourceResourceFromResourcegroupsresource", {
        groupArn: "string",
        resourceArn: "string",
    });
    
    type: aws:resourcegroups:Resource
    properties:
        groupArn: string
        resourceArn: string
    

    Resource 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 Resource resource accepts the following input properties:

    GroupArn string

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    ResourceArn string
    The ARN of the resource to be added to the group.
    GroupArn string

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    ResourceArn string
    The ARN of the resource to be added to the group.
    groupArn String

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    resourceArn String
    The ARN of the resource to be added to the group.
    groupArn string

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    resourceArn string
    The ARN of the resource to be added to the group.
    group_arn str

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    resource_arn str
    The ARN of the resource to be added to the group.
    groupArn String

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    resourceArn String
    The ARN of the resource to be added to the group.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    ResourceType string
    The resource type of a resource, such as AWS::EC2::Instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    ResourceType string
    The resource type of a resource, such as AWS::EC2::Instance.
    id String
    The provider-assigned unique ID for this managed resource.
    resourceType String
    The resource type of a resource, such as AWS::EC2::Instance.
    id string
    The provider-assigned unique ID for this managed resource.
    resourceType string
    The resource type of a resource, such as AWS::EC2::Instance.
    id str
    The provider-assigned unique ID for this managed resource.
    resource_type str
    The resource type of a resource, such as AWS::EC2::Instance.
    id String
    The provider-assigned unique ID for this managed resource.
    resourceType String
    The resource type of a resource, such as AWS::EC2::Instance.

    Look up Existing Resource Resource

    Get an existing Resource 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?: ResourceState, opts?: CustomResourceOptions): Resource
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_arn: Optional[str] = None,
            resource_arn: Optional[str] = None,
            resource_type: Optional[str] = None) -> Resource
    func GetResource(ctx *Context, name string, id IDInput, state *ResourceState, opts ...ResourceOption) (*Resource, error)
    public static Resource Get(string name, Input<string> id, ResourceState? state, CustomResourceOptions? opts = null)
    public static Resource get(String name, Output<String> id, ResourceState 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:
    GroupArn string

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    ResourceArn string
    The ARN of the resource to be added to the group.
    ResourceType string
    The resource type of a resource, such as AWS::EC2::Instance.
    GroupArn string

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    ResourceArn string
    The ARN of the resource to be added to the group.
    ResourceType string
    The resource type of a resource, such as AWS::EC2::Instance.
    groupArn String

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    resourceArn String
    The ARN of the resource to be added to the group.
    resourceType String
    The resource type of a resource, such as AWS::EC2::Instance.
    groupArn string

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    resourceArn string
    The ARN of the resource to be added to the group.
    resourceType string
    The resource type of a resource, such as AWS::EC2::Instance.
    group_arn str

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    resource_arn str
    The ARN of the resource to be added to the group.
    resource_type str
    The resource type of a resource, such as AWS::EC2::Instance.
    groupArn String

    The name or the ARN of the resource group to add resources to.

    The following arguments are optional:

    resourceArn String
    The ARN of the resource to be added to the group.
    resourceType String
    The resource type of a resource, such as AWS::EC2::Instance.

    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.33.1 published on Thursday, May 2, 2024 by Pulumi