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);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:
- Default
Instance stringProfile Arn 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.
- Service
Role stringArn The ARN of an IAM role that the OpsWorks service will act as.
- Agent
Version string If set to
"LATEST", OpsWorks will automatically install the latest version.- Berkshelf
Version string If
manage_berkshelfis enabled, the version of Berkshelf to use.- Color string
Color to paint next to the stack’s resources in the OpsWorks console.
- Configuration
Manager stringName Name of the configuration manager to use. Defaults to “Chef”.
- Configuration
Manager stringVersion Version of the configuration manager to use. Defaults to “11.4”.
- Custom
Cookbooks List<StackSources Custom Cookbooks Source Args> When
use_custom_cookbooksis set, provide this sub-object as described below.- Custom
Json string Custom JSON attributes to apply to the entire stack.
- Default
Availability stringZone Name of the availability zone where instances will be created by default. This is required unless you set
vpc_id.- Default
Os string Name of OS that will be installed on instances by default.
- Default
Root stringDevice Type Name of the type of root device instances will have by default.
- Default
Ssh stringKey Name Name of the SSH keypair that instances will have by default.
- Default
Subnet stringId Id of the subnet in which instances will be created by default. Mandatory if
vpc_idis set, and forbidden if it isn’t.- Hostname
Theme string 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 string
The name of the stack.
- Dictionary<string, string>
A map of tags to assign to the resource.
- Use
Custom boolCookbooks Boolean value controlling whether the custom cookbook settings are enabled.
- Use
Opsworks boolSecurity Groups Boolean value controlling whether the standard OpsWorks security groups apply to created instances.
- Vpc
Id string The id of the VPC that this stack belongs to.
- Default
Instance stringProfile Arn 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.
- Service
Role stringArn The ARN of an IAM role that the OpsWorks service will act as.
- Agent
Version string If set to
"LATEST", OpsWorks will automatically install the latest version.- Berkshelf
Version string If
manage_berkshelfis enabled, the version of Berkshelf to use.- Color string
Color to paint next to the stack’s resources in the OpsWorks console.
- Configuration
Manager stringName Name of the configuration manager to use. Defaults to “Chef”.
- Configuration
Manager stringVersion Version of the configuration manager to use. Defaults to “11.4”.
- Custom
Cookbooks []StackSources Custom Cookbooks Source When
use_custom_cookbooksis set, provide this sub-object as described below.- Custom
Json string Custom JSON attributes to apply to the entire stack.
- Default
Availability stringZone Name of the availability zone where instances will be created by default. This is required unless you set
vpc_id.- Default
Os string Name of OS that will be installed on instances by default.
- Default
Root stringDevice Type Name of the type of root device instances will have by default.
- Default
Ssh stringKey Name Name of the SSH keypair that instances will have by default.
- Default
Subnet stringId Id of the subnet in which instances will be created by default. Mandatory if
vpc_idis set, and forbidden if it isn’t.- Hostname
Theme string 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 string
The name of the stack.
- map[string]string
A map of tags to assign to the resource.
- Use
Custom boolCookbooks Boolean value controlling whether the custom cookbook settings are enabled.
- Use
Opsworks boolSecurity Groups Boolean value controlling whether the standard OpsWorks security groups apply to created instances.
- Vpc
Id string The id of the VPC that this stack belongs to.
- default
Instance stringProfile Arn 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.
- service
Role stringArn The ARN of an IAM role that the OpsWorks service will act as.
- agent
Version string If set to
"LATEST", OpsWorks will automatically install the latest version.- berkshelf
Version string If
manage_berkshelfis enabled, the version of Berkshelf to use.- color string
Color to paint next to the stack’s resources in the OpsWorks console.
- configuration
Manager stringName Name of the configuration manager to use. Defaults to “Chef”.
- configuration
Manager stringVersion Version of the configuration manager to use. Defaults to “11.4”.
- custom
Cookbooks StackSources Custom Cookbooks Source[] When
use_custom_cookbooksis set, provide this sub-object as described below.- custom
Json string Custom JSON attributes to apply to the entire stack.
- default
Availability stringZone Name of the availability zone where instances will be created by default. This is required unless you set
vpc_id.- default
Os string Name of OS that will be installed on instances by default.
- default
Root stringDevice Type Name of the type of root device instances will have by default.
- default
Ssh stringKey Name Name of the SSH keypair that instances will have by default.
- default
Subnet stringId Id of the subnet in which instances will be created by default. Mandatory if
vpc_idis set, and forbidden if it isn’t.- hostname
Theme string Keyword representing the naming scheme that will be used for instance hostnames within this stack.
- manage
Berkshelf boolean Boolean value controlling whether Opsworks will run Berkshelf for this stack.
- name string
The name of the stack.
- {[key: string]: string}
A map of tags to assign to the resource.
- use
Custom booleanCookbooks Boolean value controlling whether the custom cookbook settings are enabled.
- use
Opsworks booleanSecurity Groups Boolean value controlling whether the standard OpsWorks security groups apply to created instances.
- vpc
Id string The id of the VPC that this stack belongs to.
- default_
instance_ strprofile_ arn 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_ strarn 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_berkshelfis enabled, the version of Berkshelf to use.- color str
Color to paint next to the stack’s resources in the OpsWorks console.
- configuration_
manager_ strname Name of the configuration manager to use. Defaults to “Chef”.
- configuration_
manager_ strversion Version of the configuration manager to use. Defaults to “11.4”.
- custom_
cookbooks_ List[Stacksources Custom Cookbooks Source] When
use_custom_cookbooksis set, provide this sub-object as described below.- custom_
json str Custom JSON attributes to apply to the entire stack.
- default_
availability_ strzone 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_ strdevice_ type Name of the type of root device instances will have by default.
- default_
ssh_ strkey_ name Name of the SSH keypair that instances will have by default.
- default_
subnet_ strid Id of the subnet in which instances will be created by default. Mandatory if
vpc_idis 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.
- Dict[str, str]
A map of tags to assign to the resource.
- use_
custom_ boolcookbooks Boolean value controlling whether the custom cookbook settings are enabled.
- use_
opsworks_ boolsecurity_ groups 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:
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): Stackstatic 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:
- Agent
Version string If set to
"LATEST", OpsWorks will automatically install the latest version.- Arn string
- Berkshelf
Version string If
manage_berkshelfis enabled, the version of Berkshelf to use.- Color string
Color to paint next to the stack’s resources in the OpsWorks console.
- Configuration
Manager stringName Name of the configuration manager to use. Defaults to “Chef”.
- Configuration
Manager stringVersion Version of the configuration manager to use. Defaults to “11.4”.
- Custom
Cookbooks List<StackSources Custom Cookbooks Source Args> When
use_custom_cookbooksis set, provide this sub-object as described below.- Custom
Json string Custom JSON attributes to apply to the entire stack.
- Default
Availability stringZone Name of the availability zone where instances will be created by default. This is required unless you set
vpc_id.- Default
Instance stringProfile Arn The ARN of an IAM Instance Profile that created instances will have by default.
- Default
Os string Name of OS that will be installed on instances by default.
- Default
Root stringDevice Type Name of the type of root device instances will have by default.
- Default
Ssh stringKey Name Name of the SSH keypair that instances will have by default.
- Default
Subnet stringId Id of the subnet in which instances will be created by default. Mandatory if
vpc_idis set, and forbidden if it isn’t.- Hostname
Theme string 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 string
The name of the stack.
- Region string
The name of the region where the stack will exist.
- Service
Role stringArn The ARN of an IAM role that the OpsWorks service will act as.
- Stack
Endpoint string - Dictionary<string, string>
A map of tags to assign to the resource.
- Use
Custom boolCookbooks Boolean value controlling whether the custom cookbook settings are enabled.
- Use
Opsworks boolSecurity Groups Boolean value controlling whether the standard OpsWorks security groups apply to created instances.
- Vpc
Id string The id of the VPC that this stack belongs to.
- Agent
Version string If set to
"LATEST", OpsWorks will automatically install the latest version.- Arn string
- Berkshelf
Version string If
manage_berkshelfis enabled, the version of Berkshelf to use.- Color string
Color to paint next to the stack’s resources in the OpsWorks console.
- Configuration
Manager stringName Name of the configuration manager to use. Defaults to “Chef”.
- Configuration
Manager stringVersion Version of the configuration manager to use. Defaults to “11.4”.
- Custom
Cookbooks []StackSources Custom Cookbooks Source When
use_custom_cookbooksis set, provide this sub-object as described below.- Custom
Json string Custom JSON attributes to apply to the entire stack.
- Default
Availability stringZone Name of the availability zone where instances will be created by default. This is required unless you set
vpc_id.- Default
Instance stringProfile Arn The ARN of an IAM Instance Profile that created instances will have by default.
- Default
Os string Name of OS that will be installed on instances by default.
- Default
Root stringDevice Type Name of the type of root device instances will have by default.
- Default
Ssh stringKey Name Name of the SSH keypair that instances will have by default.
- Default
Subnet stringId Id of the subnet in which instances will be created by default. Mandatory if
vpc_idis set, and forbidden if it isn’t.- Hostname
Theme string 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 string
The name of the stack.
- Region string
The name of the region where the stack will exist.
- Service
Role stringArn The ARN of an IAM role that the OpsWorks service will act as.
- Stack
Endpoint string - map[string]string
A map of tags to assign to the resource.
- Use
Custom boolCookbooks Boolean value controlling whether the custom cookbook settings are enabled.
- Use
Opsworks boolSecurity Groups Boolean value controlling whether the standard OpsWorks security groups apply to created instances.
- Vpc
Id string The id of the VPC that this stack belongs to.
- agent
Version string If set to
"LATEST", OpsWorks will automatically install the latest version.- arn string
- berkshelf
Version string If
manage_berkshelfis enabled, the version of Berkshelf to use.- color string
Color to paint next to the stack’s resources in the OpsWorks console.
- configuration
Manager stringName Name of the configuration manager to use. Defaults to “Chef”.
- configuration
Manager stringVersion Version of the configuration manager to use. Defaults to “11.4”.
- custom
Cookbooks StackSources Custom Cookbooks Source[] When
use_custom_cookbooksis set, provide this sub-object as described below.- custom
Json string Custom JSON attributes to apply to the entire stack.
- default
Availability stringZone Name of the availability zone where instances will be created by default. This is required unless you set
vpc_id.- default
Instance stringProfile Arn The ARN of an IAM Instance Profile that created instances will have by default.
- default
Os string Name of OS that will be installed on instances by default.
- default
Root stringDevice Type Name of the type of root device instances will have by default.
- default
Ssh stringKey Name Name of the SSH keypair that instances will have by default.
- default
Subnet stringId Id of the subnet in which instances will be created by default. Mandatory if
vpc_idis set, and forbidden if it isn’t.- hostname
Theme string Keyword representing the naming scheme that will be used for instance hostnames within this stack.
- manage
Berkshelf 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.
- service
Role stringArn The ARN of an IAM role that the OpsWorks service will act as.
- stack
Endpoint string - {[key: string]: string}
A map of tags to assign to the resource.
- use
Custom booleanCookbooks Boolean value controlling whether the custom cookbook settings are enabled.
- use
Opsworks booleanSecurity Groups Boolean value controlling whether the standard OpsWorks security groups apply to created instances.
- vpc
Id 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_berkshelfis enabled, the version of Berkshelf to use.- color str
Color to paint next to the stack’s resources in the OpsWorks console.
- configuration_
manager_ strname Name of the configuration manager to use. Defaults to “Chef”.
- configuration_
manager_ strversion Version of the configuration manager to use. Defaults to “11.4”.
- custom_
cookbooks_ List[Stacksources Custom Cookbooks Source] When
use_custom_cookbooksis set, provide this sub-object as described below.- custom_
json str Custom JSON attributes to apply to the entire stack.
- default_
availability_ strzone Name of the availability zone where instances will be created by default. This is required unless you set
vpc_id.- default_
instance_ strprofile_ arn 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_ strdevice_ type Name of the type of root device instances will have by default.
- default_
ssh_ strkey_ name Name of the SSH keypair that instances will have by default.
- default_
subnet_ strid Id of the subnet in which instances will be created by default. Mandatory if
vpc_idis 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_ strarn The ARN of an IAM role that the OpsWorks service will act as.
- stack_
endpoint str - Dict[str, str]
A map of tags to assign to the resource.
- use_
custom_ boolcookbooks Boolean value controlling whether the custom cookbook settings are enabled.
- use_
opsworks_ boolsecurity_ groups 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
- 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.
- Ssh
Key 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.
- Ssh
Key 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.
- ssh
Key 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.
- ssh
Key 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
awsTerraform Provider.