Stack

Provides an OpsWorks stack resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var main = new Aws.OpsWorks.Stack("main", new Aws.OpsWorks.StackArgs
        {
            CustomJson = @"{
 ""foobar"": {
    ""version"": ""1.0.0""
  }
}

",
            DefaultInstanceProfileArn = aws_iam_instance_profile.Opsworks.Arn,
            Region = "us-west-1",
            ServiceRoleArn = aws_iam_role.Opsworks.Arn,
            Tags = 
            {
                { "Name", "foobar-stack" },
            },
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/opsworks"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := opsworks.NewStack(ctx, "main", &opsworks.StackArgs{
            CustomJson:                pulumi.String(fmt.Sprintf("%v%v%v%v%v%v", "{\n", " \"foobar\": {\n", "    \"version\": \"1.0.0\"\n", "  }\n", "}\n", "\n")),
            DefaultInstanceProfileArn: pulumi.String(aws_iam_instance_profile.Opsworks.Arn),
            Region:                    pulumi.String("us-west-1"),
            ServiceRoleArn:            pulumi.String(aws_iam_role.Opsworks.Arn),
            Tags: pulumi.StringMap{
                "Name": pulumi.String("foobar-stack"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

main = aws.opsworks.Stack("main",
    custom_json="""{
 "foobar": {
    "version": "1.0.0"
  }
}

""",
    default_instance_profile_arn=aws_iam_instance_profile["opsworks"]["arn"],
    region="us-west-1",
    service_role_arn=aws_iam_role["opsworks"]["arn"],
    tags={
        "Name": "foobar-stack",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const main = new aws.opsworks.Stack("main", {
    customJson: `{
 "foobar": {
    "version": "1.0.0"
  }
}
`,
    defaultInstanceProfileArn: aws_iam_instance_profile_opsworks.arn,
    region: "us-west-1",
    serviceRoleArn: aws_iam_role_opsworks.arn,
    tags: {
        Name: "foobar-stack",
    },
});

Create a Stack Resource

new Stack(name: string, args: StackArgs, opts?: CustomResourceOptions);
def Stack(resource_name, opts=None, agent_version=None, berkshelf_version=None, color=None, configuration_manager_name=None, configuration_manager_version=None, custom_cookbooks_sources=None, custom_json=None, default_availability_zone=None, default_instance_profile_arn=None, default_os=None, default_root_device_type=None, default_ssh_key_name=None, default_subnet_id=None, hostname_theme=None, manage_berkshelf=None, name=None, region=None, service_role_arn=None, tags=None, use_custom_cookbooks=None, use_opsworks_security_groups=None, vpc_id=None, __props__=None);
func NewStack(ctx *Context, name string, args StackArgs, opts ...ResourceOption) (*Stack, error)
public Stack(string name, StackArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args StackArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args StackArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args StackArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Stack Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Stack resource accepts the following input properties:

DefaultInstanceProfileArn string

The ARN of an IAM Instance Profile that created instances will have by default.

Region string

The name of the region where the stack will exist.

ServiceRoleArn string

The ARN of an IAM role that the OpsWorks service will act as.

AgentVersion string

If set to "LATEST", OpsWorks will automatically install the latest version.

BerkshelfVersion string

If manage_berkshelf is enabled, the version of Berkshelf to use.

Color string

Color to paint next to the stack’s resources in the OpsWorks console.

ConfigurationManagerName string

Name of the configuration manager to use. Defaults to “Chef”.

ConfigurationManagerVersion string

Version of the configuration manager to use. Defaults to “11.4”.

CustomCookbooksSources List<StackCustomCookbooksSourceArgs>

When use_custom_cookbooks is set, provide this sub-object as described below.

CustomJson string

Custom JSON attributes to apply to the entire stack.

DefaultAvailabilityZone string

Name of the availability zone where instances will be created by default. This is required unless you set vpc_id.

DefaultOs string

Name of OS that will be installed on instances by default.

DefaultRootDeviceType string

Name of the type of root device instances will have by default.

DefaultSshKeyName string

Name of the SSH keypair that instances will have by default.

DefaultSubnetId string

Id of the subnet in which instances will be created by default. Mandatory if vpc_id is set, and forbidden if it isn’t.

HostnameTheme string

Keyword representing the naming scheme that will be used for instance hostnames within this stack.

ManageBerkshelf bool

Boolean value controlling whether Opsworks will run Berkshelf for this stack.

Name string

The name of the stack.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

UseCustomCookbooks bool

Boolean value controlling whether the custom cookbook settings are enabled.

UseOpsworksSecurityGroups bool

Boolean value controlling whether the standard OpsWorks security groups apply to created instances.

VpcId string

The id of the VPC that this stack belongs to.

DefaultInstanceProfileArn string

The ARN of an IAM Instance Profile that created instances will have by default.

Region string

The name of the region where the stack will exist.

ServiceRoleArn string

The ARN of an IAM role that the OpsWorks service will act as.

AgentVersion string

If set to "LATEST", OpsWorks will automatically install the latest version.

BerkshelfVersion string

If manage_berkshelf is enabled, the version of Berkshelf to use.

Color string

Color to paint next to the stack’s resources in the OpsWorks console.

ConfigurationManagerName string

Name of the configuration manager to use. Defaults to “Chef”.

ConfigurationManagerVersion string

Version of the configuration manager to use. Defaults to “11.4”.

CustomCookbooksSources []StackCustomCookbooksSource

When use_custom_cookbooks is set, provide this sub-object as described below.

CustomJson string

Custom JSON attributes to apply to the entire stack.

DefaultAvailabilityZone string

Name of the availability zone where instances will be created by default. This is required unless you set vpc_id.

DefaultOs string

Name of OS that will be installed on instances by default.

DefaultRootDeviceType string

Name of the type of root device instances will have by default.

DefaultSshKeyName string

Name of the SSH keypair that instances will have by default.

DefaultSubnetId string

Id of the subnet in which instances will be created by default. Mandatory if vpc_id is set, and forbidden if it isn’t.

HostnameTheme string

Keyword representing the naming scheme that will be used for instance hostnames within this stack.

ManageBerkshelf bool

Boolean value controlling whether Opsworks will run Berkshelf for this stack.

Name string

The name of the stack.

Tags map[string]string

A map of tags to assign to the resource.

UseCustomCookbooks bool

Boolean value controlling whether the custom cookbook settings are enabled.

UseOpsworksSecurityGroups bool

Boolean value controlling whether the standard OpsWorks security groups apply to created instances.

VpcId string

The id of the VPC that this stack belongs to.

defaultInstanceProfileArn string

The ARN of an IAM Instance Profile that created instances will have by default.

region string

The name of the region where the stack will exist.

serviceRoleArn string

The ARN of an IAM role that the OpsWorks service will act as.

agentVersion string

If set to "LATEST", OpsWorks will automatically install the latest version.

berkshelfVersion string

If manage_berkshelf is enabled, the version of Berkshelf to use.

color string

Color to paint next to the stack’s resources in the OpsWorks console.

configurationManagerName string

Name of the configuration manager to use. Defaults to “Chef”.

configurationManagerVersion string

Version of the configuration manager to use. Defaults to “11.4”.

customCookbooksSources StackCustomCookbooksSource[]

When use_custom_cookbooks is set, provide this sub-object as described below.

customJson string

Custom JSON attributes to apply to the entire stack.

defaultAvailabilityZone string

Name of the availability zone where instances will be created by default. This is required unless you set vpc_id.

defaultOs string

Name of OS that will be installed on instances by default.

defaultRootDeviceType string

Name of the type of root device instances will have by default.

defaultSshKeyName string

Name of the SSH keypair that instances will have by default.

defaultSubnetId string

Id of the subnet in which instances will be created by default. Mandatory if vpc_id is set, and forbidden if it isn’t.

hostnameTheme string

Keyword representing the naming scheme that will be used for instance hostnames within this stack.

manageBerkshelf boolean

Boolean value controlling whether Opsworks will run Berkshelf for this stack.

name string

The name of the stack.

tags {[key: string]: string}

A map of tags to assign to the resource.

useCustomCookbooks boolean

Boolean value controlling whether the custom cookbook settings are enabled.

useOpsworksSecurityGroups boolean

Boolean value controlling whether the standard OpsWorks security groups apply to created instances.

vpcId string

The id of the VPC that this stack belongs to.

default_instance_profile_arn str

The ARN of an IAM Instance Profile that created instances will have by default.

region str

The name of the region where the stack will exist.

service_role_arn str

The ARN of an IAM role that the OpsWorks service will act as.

agent_version str

If set to "LATEST", OpsWorks will automatically install the latest version.

berkshelf_version str

If manage_berkshelf is enabled, the version of Berkshelf to use.

color str

Color to paint next to the stack’s resources in the OpsWorks console.

configuration_manager_name str

Name of the configuration manager to use. Defaults to “Chef”.

configuration_manager_version str

Version of the configuration manager to use. Defaults to “11.4”.

custom_cookbooks_sources List[StackCustomCookbooksSource]

When use_custom_cookbooks is set, provide this sub-object as described below.

custom_json str

Custom JSON attributes to apply to the entire stack.

default_availability_zone str

Name of the availability zone where instances will be created by default. This is required unless you set vpc_id.

default_os str

Name of OS that will be installed on instances by default.

default_root_device_type str

Name of the type of root device instances will have by default.

default_ssh_key_name str

Name of the SSH keypair that instances will have by default.

default_subnet_id str

Id of the subnet in which instances will be created by default. Mandatory if vpc_id is set, and forbidden if it isn’t.

hostname_theme str

Keyword representing the naming scheme that will be used for instance hostnames within this stack.

manage_berkshelf bool

Boolean value controlling whether Opsworks will run Berkshelf for this stack.

name str

The name of the stack.

tags Dict[str, str]

A map of tags to assign to the resource.

use_custom_cookbooks bool

Boolean value controlling whether the custom cookbook settings are enabled.

use_opsworks_security_groups bool

Boolean value controlling whether the standard OpsWorks security groups apply to created instances.

vpc_id str

The id of the VPC that this stack belongs to.

Outputs

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

Arn string
Id string
The provider-assigned unique ID for this managed resource.
StackEndpoint string
Arn string
Id string
The provider-assigned unique ID for this managed resource.
StackEndpoint string
arn string
id string
The provider-assigned unique ID for this managed resource.
stackEndpoint string
arn str
id str
The provider-assigned unique ID for this managed resource.
stack_endpoint str

Look up an Existing Stack Resource

Get an existing Stack 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?: StackState, opts?: CustomResourceOptions): Stack
static get(resource_name, id, opts=None, agent_version=None, arn=None, berkshelf_version=None, color=None, configuration_manager_name=None, configuration_manager_version=None, custom_cookbooks_sources=None, custom_json=None, default_availability_zone=None, default_instance_profile_arn=None, default_os=None, default_root_device_type=None, default_ssh_key_name=None, default_subnet_id=None, hostname_theme=None, manage_berkshelf=None, name=None, region=None, service_role_arn=None, stack_endpoint=None, tags=None, use_custom_cookbooks=None, use_opsworks_security_groups=None, vpc_id=None, __props__=None);
func GetStack(ctx *Context, name string, id IDInput, state *StackState, opts ...ResourceOption) (*Stack, error)
public static Stack Get(string name, Input<string> id, StackState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AgentVersion string

If set to "LATEST", OpsWorks will automatically install the latest version.

Arn string
BerkshelfVersion string

If manage_berkshelf is enabled, the version of Berkshelf to use.

Color string

Color to paint next to the stack’s resources in the OpsWorks console.

ConfigurationManagerName string

Name of the configuration manager to use. Defaults to “Chef”.

ConfigurationManagerVersion string

Version of the configuration manager to use. Defaults to “11.4”.

CustomCookbooksSources List<StackCustomCookbooksSourceArgs>

When use_custom_cookbooks is set, provide this sub-object as described below.

CustomJson string

Custom JSON attributes to apply to the entire stack.

DefaultAvailabilityZone string

Name of the availability zone where instances will be created by default. This is required unless you set vpc_id.

DefaultInstanceProfileArn string

The ARN of an IAM Instance Profile that created instances will have by default.

DefaultOs string

Name of OS that will be installed on instances by default.

DefaultRootDeviceType string

Name of the type of root device instances will have by default.

DefaultSshKeyName string

Name of the SSH keypair that instances will have by default.

DefaultSubnetId string

Id of the subnet in which instances will be created by default. Mandatory if vpc_id is set, and forbidden if it isn’t.

HostnameTheme string

Keyword representing the naming scheme that will be used for instance hostnames within this stack.

ManageBerkshelf bool

Boolean value controlling whether Opsworks will run Berkshelf for this stack.

Name string

The name of the stack.

Region string

The name of the region where the stack will exist.

ServiceRoleArn string

The ARN of an IAM role that the OpsWorks service will act as.

StackEndpoint string
Tags Dictionary<string, string>

A map of tags to assign to the resource.

UseCustomCookbooks bool

Boolean value controlling whether the custom cookbook settings are enabled.

UseOpsworksSecurityGroups bool

Boolean value controlling whether the standard OpsWorks security groups apply to created instances.

VpcId string

The id of the VPC that this stack belongs to.

AgentVersion string

If set to "LATEST", OpsWorks will automatically install the latest version.

Arn string
BerkshelfVersion string

If manage_berkshelf is enabled, the version of Berkshelf to use.

Color string

Color to paint next to the stack’s resources in the OpsWorks console.

ConfigurationManagerName string

Name of the configuration manager to use. Defaults to “Chef”.

ConfigurationManagerVersion string

Version of the configuration manager to use. Defaults to “11.4”.

CustomCookbooksSources []StackCustomCookbooksSource

When use_custom_cookbooks is set, provide this sub-object as described below.

CustomJson string

Custom JSON attributes to apply to the entire stack.

DefaultAvailabilityZone string

Name of the availability zone where instances will be created by default. This is required unless you set vpc_id.

DefaultInstanceProfileArn string

The ARN of an IAM Instance Profile that created instances will have by default.

DefaultOs string

Name of OS that will be installed on instances by default.

DefaultRootDeviceType string

Name of the type of root device instances will have by default.

DefaultSshKeyName string

Name of the SSH keypair that instances will have by default.

DefaultSubnetId string

Id of the subnet in which instances will be created by default. Mandatory if vpc_id is set, and forbidden if it isn’t.

HostnameTheme string

Keyword representing the naming scheme that will be used for instance hostnames within this stack.

ManageBerkshelf bool

Boolean value controlling whether Opsworks will run Berkshelf for this stack.

Name string

The name of the stack.

Region string

The name of the region where the stack will exist.

ServiceRoleArn string

The ARN of an IAM role that the OpsWorks service will act as.

StackEndpoint string
Tags map[string]string

A map of tags to assign to the resource.

UseCustomCookbooks bool

Boolean value controlling whether the custom cookbook settings are enabled.

UseOpsworksSecurityGroups bool

Boolean value controlling whether the standard OpsWorks security groups apply to created instances.

VpcId string

The id of the VPC that this stack belongs to.

agentVersion string

If set to "LATEST", OpsWorks will automatically install the latest version.

arn string
berkshelfVersion string

If manage_berkshelf is enabled, the version of Berkshelf to use.

color string

Color to paint next to the stack’s resources in the OpsWorks console.

configurationManagerName string

Name of the configuration manager to use. Defaults to “Chef”.

configurationManagerVersion string

Version of the configuration manager to use. Defaults to “11.4”.

customCookbooksSources StackCustomCookbooksSource[]

When use_custom_cookbooks is set, provide this sub-object as described below.

customJson string

Custom JSON attributes to apply to the entire stack.

defaultAvailabilityZone string

Name of the availability zone where instances will be created by default. This is required unless you set vpc_id.

defaultInstanceProfileArn string

The ARN of an IAM Instance Profile that created instances will have by default.

defaultOs string

Name of OS that will be installed on instances by default.

defaultRootDeviceType string

Name of the type of root device instances will have by default.

defaultSshKeyName string

Name of the SSH keypair that instances will have by default.

defaultSubnetId string

Id of the subnet in which instances will be created by default. Mandatory if vpc_id is set, and forbidden if it isn’t.

hostnameTheme string

Keyword representing the naming scheme that will be used for instance hostnames within this stack.

manageBerkshelf boolean

Boolean value controlling whether Opsworks will run Berkshelf for this stack.

name string

The name of the stack.

region string

The name of the region where the stack will exist.

serviceRoleArn string

The ARN of an IAM role that the OpsWorks service will act as.

stackEndpoint string
tags {[key: string]: string}

A map of tags to assign to the resource.

useCustomCookbooks boolean

Boolean value controlling whether the custom cookbook settings are enabled.

useOpsworksSecurityGroups boolean

Boolean value controlling whether the standard OpsWorks security groups apply to created instances.

vpcId string

The id of the VPC that this stack belongs to.

agent_version str

If set to "LATEST", OpsWorks will automatically install the latest version.

arn str
berkshelf_version str

If manage_berkshelf is enabled, the version of Berkshelf to use.

color str

Color to paint next to the stack’s resources in the OpsWorks console.

configuration_manager_name str

Name of the configuration manager to use. Defaults to “Chef”.

configuration_manager_version str

Version of the configuration manager to use. Defaults to “11.4”.

custom_cookbooks_sources List[StackCustomCookbooksSource]

When use_custom_cookbooks is set, provide this sub-object as described below.

custom_json str

Custom JSON attributes to apply to the entire stack.

default_availability_zone str

Name of the availability zone where instances will be created by default. This is required unless you set vpc_id.

default_instance_profile_arn str

The ARN of an IAM Instance Profile that created instances will have by default.

default_os str

Name of OS that will be installed on instances by default.

default_root_device_type str

Name of the type of root device instances will have by default.

default_ssh_key_name str

Name of the SSH keypair that instances will have by default.

default_subnet_id str

Id of the subnet in which instances will be created by default. Mandatory if vpc_id is set, and forbidden if it isn’t.

hostname_theme str

Keyword representing the naming scheme that will be used for instance hostnames within this stack.

manage_berkshelf bool

Boolean value controlling whether Opsworks will run Berkshelf for this stack.

name str

The name of the stack.

region str

The name of the region where the stack will exist.

service_role_arn str

The ARN of an IAM role that the OpsWorks service will act as.

stack_endpoint str
tags Dict[str, str]

A map of tags to assign to the resource.

use_custom_cookbooks bool

Boolean value controlling whether the custom cookbook settings are enabled.

use_opsworks_security_groups bool

Boolean value controlling whether the standard OpsWorks security groups apply to created instances.

vpc_id str

The id of the VPC that this stack belongs to.

Supporting Types

StackCustomCookbooksSource

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Type string

The type of source to use. For example, “archive”.

Url string

The URL where the cookbooks resource can be found.

Password string

Password to use when authenticating to the source. The provider cannot perform drift detection of this configuration.

Revision string

For sources that are version-aware, the revision to use.

SshKey string

SSH key to use when authenticating to the source. The provider cannot perform drift detection of this configuration.

Username string

Username to use when authenticating to the source.

Type string

The type of source to use. For example, “archive”.

Url string

The URL where the cookbooks resource can be found.

Password string

Password to use when authenticating to the source. The provider cannot perform drift detection of this configuration.

Revision string

For sources that are version-aware, the revision to use.

SshKey string

SSH key to use when authenticating to the source. The provider cannot perform drift detection of this configuration.

Username string

Username to use when authenticating to the source.

type string

The type of source to use. For example, “archive”.

url string

The URL where the cookbooks resource can be found.

password string

Password to use when authenticating to the source. The provider cannot perform drift detection of this configuration.

revision string

For sources that are version-aware, the revision to use.

sshKey string

SSH key to use when authenticating to the source. The provider cannot perform drift detection of this configuration.

username string

Username to use when authenticating to the source.

type str

The type of source to use. For example, “archive”.

url str

The URL where the cookbooks resource can be found.

password str

Password to use when authenticating to the source. The provider cannot perform drift detection of this configuration.

revision str

For sources that are version-aware, the revision to use.

sshKey str

SSH key to use when authenticating to the source. The provider cannot perform drift detection of this configuration.

username str

Username to use when authenticating to the source.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.