AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.2 published on Friday, Jun 24, 2022 by Pulumi

Resource

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

using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.CloudControl.Resource("example", new Aws.CloudControl.ResourceArgs
        {
            TypeName = "AWS::ECS::Cluster",
            DesiredState = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                { "ClusterName", "example" },
                { "Tags", new[]
                    {
                        new Dictionary<string, object?>
                        {
                            { "Key", "CostCenter" },
                            { "Value", "IT" },
                        },
                    }
                 },
            }),
        });
    }

}
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v5/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
import static com.pulumi.codegen.internal.Serialization.*;

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());

    }
}
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",
        }],
    }))
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",
        }],
    }),
});
resources:
  example:
    type: aws:cloudcontrol:Resource
    properties:
      typeName: AWS::ECS::Cluster
      desiredState:
        Fn::ToJSON:
          ClusterName: example
          Tags:
            - Key: CostCenter
              Value: IT

Create a Resource Resource

new Resource(name: string, args: ResourceArgs, opts?: CustomResourceOptions);
@overload
def Resource(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             desired_state: Optional[str] = None,
             role_arn: Optional[str] = None,
             schema: Optional[str] = None,
             type_name: Optional[str] = None,
             type_version_id: Optional[str] = None)
@overload
def Resource(resource_name: str,
             args: ResourceArgs,
             opts: Optional[ResourceOptions] = 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.

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.

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
TypeName string

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

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
TypeName string

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

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
typeName String

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

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
typeName string

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

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
type_name str

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

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
typeName String

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

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
Id string

The provider-assigned unique ID for this managed resource.

Properties string
id String

The provider-assigned unique ID for this managed resource.

properties String
id string

The provider-assigned unique ID for this managed resource.

properties string
id str

The provider-assigned unique ID for this managed resource.

properties str
id String

The provider-assigned unique ID for this managed resource.

properties String

Look up an 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
Properties string
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.

TypeVersionId string

Identifier of the CloudFormation resource type version.

DesiredState string
Properties string
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.

TypeVersionId string

Identifier of the CloudFormation resource type version.

desiredState String
properties String
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.

typeVersionId String

Identifier of the CloudFormation resource type version.

desiredState string
properties string
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.

typeVersionId string

Identifier of the CloudFormation resource type version.

desired_state str
properties str
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.

type_version_id str

Identifier of the CloudFormation resource type version.

desiredState String
properties String
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.

typeVersionId String

Identifier of the CloudFormation resource type version.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.