Introduction
Hey Ninjas! You must have heard about cloud storage. It is available for mobile or PC to store your data. Do you know who the best service provider for the cloud is? Yes, It is none other than AWS (Amazon Web Server). AWS offers many services to their users, like Ops work, CodeDeploy, Lambda, etc.

Today, we will talk about some important concepts of AWS Opsworks in Puppet Enterprise.
Creating OpsWorks using CloudFormation
In this section, we will learn how to create AWS OpsWorks for Puppet Enterprise Master (PEM) using AWS CloudFormation. You can run a Puppet Enterprise server on AWS using AWS OpsWorks for Puppet Enterprise. A Puppet Enterprise master server may be set up within 15 minutes.
There are two ways to create a PEM.
⚡ Using Console.
⚡ Using CLI.
Using Console
Let's take a look at the steps shown below.
🚩 Open the AWS CloudFormation console after logging into the AWS Management Console.
🚩 Click on Create Stack on the CloudFormation home page.
🚩 Prepare a template in Prerequisites.
🚩 Select the source of your template in Specify Template.
🚩 Give a name to your stack on the Specify stack details page. Give the admin password in the Parameters.
🚩 You can give IAM role only if you have not yet given and also you can add tags to the server you are creating with the stack.
🚩 Review your inputs and click on Create.
Using CLI
Download and install the AWS CLI in your system. You can follow the installation guide for reference.
⭐ Complete all the prerequisites before creating an OpsWorks for PEM.
⭐ Now, you have to create a service role and an instance profile. For creating both of these, AWS Opsworks provides an AWS CloudFormation template. Run the command below to create the AWS CloudFormation stack.
aws cloudformation create-stack --stack-name OpsWorksCMRoles --template-url https://s3.amazonaws.com/opsworks-cm-us-east-1-prod-default-assets/misc/opsworks-cm-roles.yaml --capabilities CAPABILITY_NAMED_IAM
Now, Find and copy the ARNs of service roles in your account after you are done with creating the stack.
aws iam list-roles --path-prefix "/service-role/" --no-paginate
Make a note of the given service role ARNs entries. Include them in the AWS CloudFormation template you are utilizing to create your Puppet master server stack.
{
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
}
}
]
},
"RoleId": "AROZZZZZZZZZZQG6R22HC",
"CreateDate": "2022-10-17T20:42:20Z",
"RoleName": "aws-opsworks-cm-ec2-role",
"Path": "/service-role/",
"Arn": "arn:aws:iam::000000000000:role/service-role/aws-opsworks-cm-ec2-role"
},
{
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "opsworks-cm.amazonaws.com"
}
}
]
},
"RoleId": "AROZZZZZZZZZZZZZZZ6QE",
"CreateDate": "2022-10-17T20:42:20Z",
"RoleName": "aws-opsworks-cm-service-role",
"Path": "/service-role/",
"Arn": "arn:aws:iam::000000000000:role/service-role/aws-opsworks-cm-service-role"
}
⭐ Rerun the create-stack command to create the OpsWorks for Puppet Enterprise master.
aws cloudformation create-stack --stack-name stack_name --template-body file://template.yaml or json --parameters ParameterKey=AdminPassword,ParameterValue="password"
⭐ You can also check the stack creation status by running the below command.
aws cloudformation describe-stacks --stack-name stack_name
⭐ Now, you can move to the next section.








