AWS OpsWorks Stack
This page shows how to write Terraform and CloudFormation for OpsWorks Stack and write them securely.
aws_opsworks_stack (Terraform)
The Stack in OpsWorks can be configured in Terraform with the resource name aws_opsworks_stack
. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_opsworks_stack" "mainstack" {
name = "php_apache2_stack"
region = var.region
vpc_id = aws_vpc.mainvpc.id
default_subnet_id = aws_subnet.public-subnet1.id
default_os = "Ubuntu 14.04 LTS"
resource "aws_opsworks_stack" "control-users-ssh-on-linux" {
name = var.opsworks_name
region = var.opsworks_region
service_role_arn = var.opsworks_service_role_arn
default_instance_profile_arn = var.opsworks_iam_instance_profile
color = var.opsworks_color
resource "aws_opsworks_stack" "main" {
name = var.name
region = data.aws_region.current.name
service_role_arn = aws_iam_role.main.arn
default_instance_profile_arn = aws_iam_instance_profile.ec2.arn
agent_version = "LATEST"
Parameters
-
agent_version
optional computed - string -
arn
optional computed - string -
berkshelf_version
optional - string -
color
optional - string -
configuration_manager_name
optional - string -
configuration_manager_version
optional - string -
custom_json
optional - string -
default_availability_zone
optional computed - string -
default_instance_profile_arn
required - string -
default_os
optional - string -
default_root_device_type
optional - string -
default_ssh_key_name
optional - string -
default_subnet_id
optional computed - string -
hostname_theme
optional - string -
id
optional computed - string -
manage_berkshelf
optional - bool -
name
required - string -
region
required - string -
service_role_arn
required - string -
stack_endpoint
optional computed - string -
tags
optional - map from string to string -
use_custom_cookbooks
optional - bool -
use_opsworks_security_groups
optional - bool -
vpc_id
optional computed - string -
custom_cookbooks_source
list block
Explanation in Terraform Registry
Provides an OpsWorks stack resource.
AWS::OpsWorks::Stack (CloudFormation)
The Stack in OpsWorks can be configured in CloudFormation with the resource name AWS::OpsWorks::Stack
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
AgentVersion
optional - String -
Attributes
optional - Map -
ChefConfiguration
optional - ChefConfiguration -
CloneAppIds
optional - List -
ClonePermissions
optional - Boolean -
ConfigurationManager
optional - StackConfigurationManager -
CustomCookbooksSource
optional - Source -
CustomJson
optional - Json -
DefaultAvailabilityZone
optional - String -
DefaultInstanceProfileArn
required - String -
DefaultOs
optional - String -
DefaultRootDeviceType
optional - String -
DefaultSshKeyName
optional - String -
DefaultSubnetId
optional - String -
EcsClusterArn
optional - String -
ElasticIps
optional - List of ElasticIp -
HostnameTheme
optional - String -
Name
required - String -
RdsDbInstances
optional - List of RdsDbInstance -
ServiceRoleArn
required - String -
SourceStackId
optional - String -
Tags
optional - List of Tag -
UseCustomCookbooks
optional - Boolean -
UseOpsworksSecurityGroups
optional - Boolean -
VpcId
optional - String
Explanation in CloudFormation Registry
Creates a new stack. For more information, see Create a New Stack. Required Permissions: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information about user permissions, see Managing User Permissions.
Frequently asked questions
What is AWS OpsWorks Stack?
AWS OpsWorks Stack is a resource for OpsWorks of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS OpsWorks Stack?
For Terraform, the 1smii/iac_terraform_aws, ricardomessiaszup/terraform_aws_opsworks_stack and shanmugakarna/terraform-elasticsearch source code examples are useful. See the Terraform Example section for further details.