AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::OpsWorksCM::Server

The AWS::OpsWorksCM::Server resource creates an AWS OpsWorks for Chef Automate or AWS OpsWorks for Puppet Enterprise configuration management server. For more information, see Create a Chef Automate Server in AWS CloudFormation or Create a Puppet Enterprise Master in AWS CloudFormation in the AWS OpsWorks User Guide, and CreateServer in the AWS OpsWorks CM API Reference.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::OpsWorksCM::Server", "Properties" : { "AssociatePublicIpAddress" : Boolean, "BackupId" : String, "BackupRetentionCount" : Integer, "DisableAutomatedBackup" : Boolean, "Engine" : String, "EngineAttributes" : [ EngineAttribute, ... ], "EngineModel" : String, "EngineVersion" : String, "InstanceProfileArn" : String, "InstanceType" : String, "KeyPair" : String, "PreferredBackupWindow" : String, "PreferredMaintenanceWindow" : String, "SecurityGroupIds" : [ String, ... ], "ServerName" : String, "ServiceRoleArn" : String, "SubnetIds" : [ String, ... ] } }

YAML

Type: "AWS::OpsWorksCM::Server" Properties: AssociatePublicIpAddress: Boolean BackupId: String BackupRetentionCount: Integer DisableAutomatedBackup: Boolean Engine: String EngineAttributes: - EngineAttribute EngineModel: String EngineVersion: String InstanceProfileArn: String InstanceType: String KeyPair: String PreferredBackupWindow: String PreferredMaintenanceWindow: String SecurityGroupIds: - String ServerName: String ServiceRoleArn: String SubnetIds: - String

Properties

AssociatePublicIpAddress

Associate a public IP address with the server. Valid values are true or false. The default value is true.

Required: No

Type: Boolean

Update requires: Replacement

BackupId

If you specify this field, AWS OpsWorks CM creates the server by using the backup represented by BackupId.

Required: No

Type: String

Update requires: Replacement

BackupRetentionCount

The number of automated backups that you want to keep. Whenever a new backup is created, AWS OpsWorks CM deletes the oldest backups if this number is exceeded. The default value is 1.

Required: No

Type: Integer

Update requires: Replacement

DisableAutomatedBackup

Enable or disable scheduled backups. Valid values are true or false. The default value is false.

Required: No

Type: Boolean

Update requires: Replacement

Engine

The configuration management engine to use. Valid values are Chef or Puppet.

Required: No

Type: String

Update requires: Replacement

EngineAttributes

In a createServer() request, EngineAttributes contains the administrator credentials to access the configuration management server. These credentials are not stored by AWS OpsWorks CM.

Attributes accepted in a createServer request for Chef Automate:

  • CHEF_PIVOTAL_KEY: A base64-encoded RSA public key. When no CHEF_PIVOTAL_KEY is set, a private key is generated by AWS OpsWorks for Chef Automate and returned in the response. The corresponding private key is required to access the Chef API.

Attributes accepted in a createServer request for Puppet Enterprise:

  • PUPPET_ADMIN_PASSWORD: An administrator password that you can use to sign in to the Puppet Enterprise console after the server is online. The password must use between 8 and 32 ASCII characters.

  • PUPPET_R10K_REMOTE: The r10k remote is the URL of your control repository (for example, ssh://git@your.git-repo.com:user/control-repo.git). Specifying an r10k remote opens TCP port 8170.

  • PUPPET_R10K_PRIVATE_KEY: If you are using a private Git repository, add PUPPET_R10K_PRIVATE_KEY to specify a PEM-encoded private SSH key.

Required: No

Type: List of EngineAttribute property types

Update requires: Replacement

EngineModel

The engine model of the server. Valid values include Monolithic for Puppet and Single for Chef.

Required: No

Type: String

Update requires: Replacement

EngineVersion

The engine version of the server. For a Chef server, the valid value for EngineVersion is 12. For a Puppet server, the valid value is 2017.

Required: No

Type: String

Update requires: Replacement

InstanceProfileArn

The instance profile ARN of the server.

Required: Yes

Type: String

Update requires: Replacement

InstanceType

The instance type for the server, as specified in the AWS CloudFormation stack. This might not be the same instance type that is shown for the server in the Amazon EC2 console.

Required: Yes

Type: String

Update requires: Replacement

KeyPair

The key pair associated with the server.

Required: No

Type: String

Update requires: Replacement

PreferredBackupWindow

The preferred backup period specified for the server.

Required: No

Type: String

Update requires: Replacement

PreferredMaintenanceWindow

The preferred maintenance period specified for the server.

Required: No

Type: String

Update requires: Replacement

SecurityGroupIds

The security group IDs for the server, as specified in the AWS CloudFormation stack. These might not be the same security groups that are shown for the server in the Amazon EC2 console.

Required: No

Type: List of String values

Update requires: Replacement

ServerName

The name of the server.

Required: No

Type: String

Update requires: Replacement

ServiceRoleArn

The service role ARN used to create the server.

Required: Yes

Type: String

Update requires: Replacement

SubnetIds

The subnet IDs specified in a createServer() request.

Required: No

Type: List of String values

Update requires: Replacement

Return Values

Ref

When you pass the logical ID of an AWS::OpsWorksCM::Server resource to the intrinsic Ref function, the function returns the server's ARN, such as arn:aws:OpsWorksCM:us-east-1:123456789012:server/server-a1bzhi.

For more information about using the Ref function, see Ref.

Fn::GetAtt

Fn::GetAtt returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

Endpoint

A DNS name that can be used to access the engine. Example: myserver-asdfghjkl.us-east-1.opsworks.io.

Arn

The Amazon Resource Name (ARN) of the server, such as arn:aws:OpsWorksCM:us-east-1:123456789012:server/server-a1bzhi.

For more information about using Fn::GetAtt, see Fn::GetAtt.

Examples

Create an AWS OpsWorks for Chef Automate server

The following example creates an AWS OpsWorks for Chef Automate server.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Parameters": { "PivotalKey": { "Type": "String" }, "Password": { "Type": "String" } }, "Resources": { "MyChefServer": { "Type": "AWS::OpsWorksCM::Server", "Properties": { "AssociatePublicIpAddress": true, "BackupRetentionCount": "12", "DisableAutomatedBackup": false, "Engine": "Chef", "EngineVersion": "12", "EngineAttributes": [ { "Name": "CHEF_PIVOTAL_KEY", "Value": { "Ref": "PivotalKey" } }, { "Name": "CHEF_DELIVERY_ADMIN_PASSWORD", "Value": { "Ref": "Password" } } ], "EngineModel": "Single", "InstanceProfileArn": "arn:aws:iam::123456789012:instance-profile/MyInstanceProfile", "InstanceType": "m4.xlarge", "PreferredBackupWindow": "08:00", "PreferredMaintenanceWindow": "Fri:08:00", "ServiceRoleArn": "arn:aws:iam::123456789012:role/MyServiceRole" } } }, "Outputs": { "endpoint": { "Description": "OpsWorksCM Server Endpoint", "Value": { "Fn::GetAtt": [ "MyChefServer", "Endpoint" ] } } } }

YAML

AWSTemplateFormatVersion: '2010-09-09' Parameters: PivotalKey: Type: String Password: Type: String Resources: MyChefServer: Type: AWS::OpsWorksCM::Server Properties: AssociatePublicIpAddress: True BackupRetentionCount: '12' DisableAutomatedBackup: False Engine: 'Chef' EngineVersion: '12' EngineAttributes: - Name: "CHEF_PIVOTAL_KEY" Value: Ref: PivotalKey - Name: "CHEF_DELIVERY_ADMIN_PASSWORD" Value: Ref: Password EngineModel: 'Single' InstanceProfileArn: "arn:aws:iam::123456789012:instance-profile/MyInstanceProfile" InstanceType: 'm4.xlarge' PreferredBackupWindow: '08:00' PreferredMaintenanceWindow: 'Fri:08:00' ServiceRoleArn: "arn:aws:iam::123456789012:role/MyServiceRole" Outputs: endpoint: Description: OpsWorksCM Server Endpoint Value: !GetAtt [MyChefServer, Endpoint]

See Also