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

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

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

aws.cloudcontrol.Resource

Explore with Pulumi AI

aws logo

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

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

    Manages a Cloud Control API Resource. The configuration and lifecycle handling of these resources is proxied through Cloud Control API handlers to the backend service.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.cloudcontrol.Resource("example", {
        typeName: "AWS::ECS::Cluster",
        desiredState: JSON.stringify({
            ClusterName: "example",
            Tags: [{
                Key: "CostCenter",
                Value: "IT",
            }],
        }),
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    
    example = aws.cloudcontrol.Resource("example",
        type_name="AWS::ECS::Cluster",
        desired_state=json.dumps({
            "ClusterName": "example",
            "Tags": [{
                "Key": "CostCenter",
                "Value": "IT",
            }],
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudcontrol"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"ClusterName": "example",
    			"Tags": []map[string]interface{}{
    				map[string]interface{}{
    					"Key":   "CostCenter",
    					"Value": "IT",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = cloudcontrol.NewResource(ctx, "example", &cloudcontrol.ResourceArgs{
    			TypeName:     pulumi.String("AWS::ECS::Cluster"),
    			DesiredState: pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.CloudControl.Resource("example", new()
        {
            TypeName = "AWS::ECS::Cluster",
            DesiredState = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["ClusterName"] = "example",
                ["Tags"] = new[]
                {
                    new Dictionary<string, object?>
                    {
                        ["Key"] = "CostCenter",
                        ["Value"] = "IT",
                    },
                },
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudcontrol.Resource;
    import com.pulumi.aws.cloudcontrol.ResourceArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 Resource("example", ResourceArgs.builder()        
                .typeName("AWS::ECS::Cluster")
                .desiredState(serializeJson(
                    jsonObject(
                        jsonProperty("ClusterName", "example"),
                        jsonProperty("Tags", jsonArray(jsonObject(
                            jsonProperty("Key", "CostCenter"),
                            jsonProperty("Value", "IT")
                        )))
                    )))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudcontrol:Resource
        properties:
          typeName: AWS::ECS::Cluster
          desiredState:
            fn::toJSON:
              ClusterName: example
              Tags:
                - Key: CostCenter
                  Value: IT
    

    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,
                 desired_state: Optional[str] = None,
                 type_name: Optional[str] = None,
                 role_arn: Optional[str] = None,
                 schema: Optional[str] = None,
                 type_version_id: 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:cloudcontrol: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 awsResourceResource = new Aws.CloudControl.Resource("awsResourceResource", new()
    {
        DesiredState = "string",
        TypeName = "string",
        RoleArn = "string",
        Schema = "string",
        TypeVersionId = "string",
    });
    
    example, err := cloudcontrol.NewResource(ctx, "awsResourceResource", &cloudcontrol.ResourceArgs{
    	DesiredState:  pulumi.String("string"),
    	TypeName:      pulumi.String("string"),
    	RoleArn:       pulumi.String("string"),
    	Schema:        pulumi.String("string"),
    	TypeVersionId: pulumi.String("string"),
    })
    
    var awsResourceResource = new Resource("awsResourceResource", ResourceArgs.builder()        
        .desiredState("string")
        .typeName("string")
        .roleArn("string")
        .schema("string")
        .typeVersionId("string")
        .build());
    
    aws_resource_resource = aws.cloudcontrol.Resource("awsResourceResource",
        desired_state="string",
        type_name="string",
        role_arn="string",
        schema="string",
        type_version_id="string")
    
    const awsResourceResource = new aws.cloudcontrol.Resource("awsResourceResource", {
        desiredState: "string",
        typeName: "string",
        roleArn: "string",
        schema: "string",
        typeVersionId: "string",
    });
    
    type: aws:cloudcontrol:Resource
    properties:
        desiredState: string
        roleArn: string
        schema: string
        typeName: string
        typeVersionId: 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:

    DesiredState string
    JSON string matching the CloudFormation resource type schema with desired configuration.
    TypeName string

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    RoleArn string
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    Schema string
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    TypeVersionId string
    Identifier of the CloudFormation resource type version.
    DesiredState string
    JSON string matching the CloudFormation resource type schema with desired configuration.
    TypeName string

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    RoleArn string
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    Schema string
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    TypeVersionId string
    Identifier of the CloudFormation resource type version.
    desiredState String
    JSON string matching the CloudFormation resource type schema with desired configuration.
    typeName String

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    roleArn String
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    schema String
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    typeVersionId String
    Identifier of the CloudFormation resource type version.
    desiredState string
    JSON string matching the CloudFormation resource type schema with desired configuration.
    typeName string

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    roleArn string
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    schema string
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    typeVersionId string
    Identifier of the CloudFormation resource type version.
    desired_state str
    JSON string matching the CloudFormation resource type schema with desired configuration.
    type_name str

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    role_arn str
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    schema str
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    type_version_id str
    Identifier of the CloudFormation resource type version.
    desiredState String
    JSON string matching the CloudFormation resource type schema with desired configuration.
    typeName String

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    roleArn String
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    schema String
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    typeVersionId String
    Identifier of the CloudFormation resource type version.

    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.
    Properties string
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    Id string
    The provider-assigned unique ID for this managed resource.
    Properties string
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    id String
    The provider-assigned unique ID for this managed resource.
    properties String
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    id string
    The provider-assigned unique ID for this managed resource.
    properties string
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    id str
    The provider-assigned unique ID for this managed resource.
    properties str
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    id String
    The provider-assigned unique ID for this managed resource.
    properties String
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].

    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,
            desired_state: Optional[str] = None,
            properties: Optional[str] = None,
            role_arn: Optional[str] = None,
            schema: Optional[str] = None,
            type_name: Optional[str] = None,
            type_version_id: 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:
    DesiredState string
    JSON string matching the CloudFormation resource type schema with desired configuration.
    Properties string
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    RoleArn string
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    Schema string
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    TypeName string

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    TypeVersionId string
    Identifier of the CloudFormation resource type version.
    DesiredState string
    JSON string matching the CloudFormation resource type schema with desired configuration.
    Properties string
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    RoleArn string
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    Schema string
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    TypeName string

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    TypeVersionId string
    Identifier of the CloudFormation resource type version.
    desiredState String
    JSON string matching the CloudFormation resource type schema with desired configuration.
    properties String
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    roleArn String
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    schema String
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    typeName String

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    typeVersionId String
    Identifier of the CloudFormation resource type version.
    desiredState string
    JSON string matching the CloudFormation resource type schema with desired configuration.
    properties string
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    roleArn string
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    schema string
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    typeName string

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    typeVersionId string
    Identifier of the CloudFormation resource type version.
    desired_state str
    JSON string matching the CloudFormation resource type schema with desired configuration.
    properties str
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    role_arn str
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    schema str
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    type_name str

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    type_version_id str
    Identifier of the CloudFormation resource type version.
    desiredState String
    JSON string matching the CloudFormation resource type schema with desired configuration.
    properties String
    JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the jsondecode() function, for example, jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"].
    roleArn String
    Amazon Resource Name (ARN) of the IAM Role to assume for operations.
    schema String
    JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same type_name, it is recommended to fetch the schema once via the aws.cloudformation.CloudFormationType data source and use this argument to reduce DescribeType API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.
    typeName String

    CloudFormation resource type name. For example, AWS::EC2::VPC.

    The following arguments are optional:

    typeVersionId String
    Identifier of the CloudFormation resource type version.

    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.32.0 published on Friday, Apr 19, 2024 by Pulumi