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_versionoptional computed - string -
arnoptional computed - string -
berkshelf_versionoptional - string -
coloroptional - string -
configuration_manager_nameoptional - string -
configuration_manager_versionoptional - string -
custom_jsonoptional - string -
default_availability_zoneoptional computed - string -
default_instance_profile_arnrequired - string -
default_osoptional - string -
default_root_device_typeoptional - string -
default_ssh_key_nameoptional - string -
default_subnet_idoptional computed - string -
hostname_themeoptional - string -
idoptional computed - string -
manage_berkshelfoptional - bool -
namerequired - string -
regionrequired - string -
service_role_arnrequired - string -
stack_endpointoptional computed - string -
tagsoptional - map from string to string -
use_custom_cookbooksoptional - bool -
use_opsworks_security_groupsoptional - bool -
vpc_idoptional computed - string -
custom_cookbooks_sourcelist 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
-
AgentVersionoptional - String -
Attributesoptional - Map -
ChefConfigurationoptional - ChefConfiguration -
CloneAppIdsoptional - List -
ClonePermissionsoptional - Boolean -
ConfigurationManageroptional - StackConfigurationManager -
CustomCookbooksSourceoptional - Source -
CustomJsonoptional - Json -
DefaultAvailabilityZoneoptional - String -
DefaultInstanceProfileArnrequired - String -
DefaultOsoptional - String -
DefaultRootDeviceTypeoptional - String -
DefaultSshKeyNameoptional - String -
DefaultSubnetIdoptional - String -
EcsClusterArnoptional - String -
ElasticIpsoptional - List of ElasticIp -
HostnameThemeoptional - String -
Namerequired - String -
RdsDbInstancesoptional - List of RdsDbInstance -
ServiceRoleArnrequired - String -
SourceStackIdoptional - String -
Tagsoptional - List of Tag -
UseCustomCookbooksoptional - Boolean -
UseOpsworksSecurityGroupsoptional - Boolean -
VpcIdoptional - 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.