aws.cloudcontrol.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;
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 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 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());
}
}
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 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:
- Desired
State string JSON string matching the CloudFormation resource type schema with desired configuration.
- Type
Name string CloudFormation resource type name. For example,
AWS::EC2::VPC
.- Role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- Type
Version stringId Identifier of the CloudFormation resource type version.
- Desired
State string JSON string matching the CloudFormation resource type schema with desired configuration.
- Type
Name string CloudFormation resource type name. For example,
AWS::EC2::VPC
.- Role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- Type
Version stringId Identifier of the CloudFormation resource type version.
- desired
State String JSON string matching the CloudFormation resource type schema with desired configuration.
- type
Name String CloudFormation resource type name. For example,
AWS::EC2::VPC
.- role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- type
Version StringId Identifier of the CloudFormation resource type version.
- desired
State string JSON string matching the CloudFormation resource type schema with desired configuration.
- type
Name string CloudFormation resource type name. For example,
AWS::EC2::VPC
.- role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- type
Version stringId 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
.- 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- type_
version_ strid Identifier of the CloudFormation resource type version.
- desired
State String JSON string matching the CloudFormation resource type schema with desired configuration.
- type
Name String CloudFormation resource type name. For example,
AWS::EC2::VPC
.- role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- type
Version StringId 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.
- Desired
State 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"]
.- Role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- Type
Name string CloudFormation resource type name. For example,
AWS::EC2::VPC
.- Type
Version stringId Identifier of the CloudFormation resource type version.
- Desired
State 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"]
.- Role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- Type
Name string CloudFormation resource type name. For example,
AWS::EC2::VPC
.- Type
Version stringId Identifier of the CloudFormation resource type version.
- desired
State 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"]
.- role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- type
Name String CloudFormation resource type name. For example,
AWS::EC2::VPC
.- type
Version StringId Identifier of the CloudFormation resource type version.
- desired
State 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"]
.- role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- type
Name string CloudFormation resource type name. For example,
AWS::EC2::VPC
.- type
Version stringId 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
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_ strid Identifier of the CloudFormation resource type version.
- desired
State 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"]
.- role
Arn 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 theaws.cloudformation.CloudFormationType
data source and use this argument to reduceDescribeType
API operation throttling. This value is marked sensitive only to prevent large plan differences from showing.- type
Name String CloudFormation resource type name. For example,
AWS::EC2::VPC
.- type
Version StringId 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.