Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
AWS is the most common platform we use when we work on the cloud. Ever thought about how to manage resources in AWS? Well, we can securely control access to AWS resources with the help of the web service known as AWS Identity and Access Management (IAM).
This article will discuss AWS Opsworks stacks with Windows. We will start our discussion by setting up the AWS Opsworks stack. Afterward, we will create a stack, authorize RDP access, and enable the custom cookbooks. At last, we will talk about the IIS layer and the steps to launch the app. So without further ado, let’s get started!
Setting Up AWS Opsworks Stack
Setting up AWS opsworks stack is the same for every operating system. You can refer to our blog AWS Opsworks Stacks with Linux to do the required set-up.
You can refer to the next section if you have done the setup.
Application on Server Stack
The server stack consists of a single application server with a public IP address. It receives user requests.
The server stack consists of the following elements:
⭐ A layer representing a collection of instances and describing how they should be set up. In the above diagram, the layer represents a group of IIS layers.
⭐ A instance thatrepresents the Amazon EC2 instance. Although layers can have any number of instances, in this case, only one instance of IIS (Internet Info Services) is configured by the layer.
⭐ An app with the necessary data to install a program on the instance.
⭐ A cookbook with unique Chef recipes supporting the IIS layer. The cookbook and app code is kept in off-site repositories like a Git repository or an archive file in an Amazon S3 bucket.
Creating the Stack
We are creating a stack first because we want something like a container to hold our instances and other resources. The stack configuration provides us with some default settings. Some of them are the AWS region (South Asia - India) and the default operating system.
To create a stack, we will follow these steps:
⭐ Add a stack to your account
If you don’t have any stack in your account, you can add it by selecting Add your first stack.
If not, you will see the AWS OpsWorks Stacks dashboard, which displays all of the stacks associated with your account. Then select Add Stack.
⭐ Setting up the stack.
While adding stack, select Chef 12 stack.
Stack Name: The name of your stack can be in the form of an alphanumeric and a hyphen only. So give your stack a name accordingly.
Region: Select South Asia - India.
Default OS: Select Windows.
Using custom Chef cookbook: Select No.
⭐ To ensure you have an IAM role and the default IAM instance profile, select Advanced.
If your account has an IAM role, choose it from the list. The role's name would be aws-opsworks-service-role if AWS OpsWorks Stacks created it.
If not, select the New IAM role.
⭐ Select Add Stack and accept the default values for the other settings.
Authorizing RDP Access
RDP stands for remote desktop protocol. It is established over HTTPS to have a secure, encrypted connection between users and EC2 instances.
We will use the RDP layer to connect you to the custom instances. Before authorizing RDP for the user, we need to give the RDP access.
To allow the RDP access:
⭐ Open the Amazon EC2 console and set the stack region (South Asia - India). Now, select Security Groups.
⭐ Select AWS-OpsWorks-RDP-Server, now choose the Inbound tab, and select Edit.
⭐ Select Add rule and specify
Type: RDP
Source: Permissible source and IP Address.
After allowing RDP access, it can be accessed by anyone. If you need to specify it to one user, you should also authorize the RDP access to that user.
For authorizing RDP access to the user:
⭐ First, go to the AWS OpsWorks Stacks dashboard, and select the IISWalkthrough stack.
⭐ Now, on the navigation pane, select Permissions.
⭐ On the Permissions page, select Edit.
⭐ Now, you’ll see a list of users. There are checkboxes for SSH/RDP under the instances column. Select the checkbox to who you want to give permission.
⭐ Select Save.
The user will now get a password with which he can get the required access to the instance.
Enabling the Custom Cookbook
Throughout this article, we used the word Chef Cookbook. DYK, what is it? AWS OpsWorks Stacks uses “Chef cookbooks” to handle tasks such as installing and configuring packages and deploying apps.
The next step that we are going to do is to enable the custom cookbook. On each instance, AWS Opsworks stacks run recipes from the local caches. Now, if we want to run our custom recipes, we must do the following:
We will be storing our cookbooks in a remote repo.
And then editing the stack to have access to the custom cookbook.
To enable the custom cookbook, follow these steps
⭐ Select Stack in the navigation pane of the AWS OpsWorks Stacks console, and then select Stack Settings in the top right.
⭐ Select Edit in the upper right corner of the Settings page.
⭐ Set Use custom Chef cookbooks to Yes on the Settings page, then type
Type of repository: S3 Archive.
⭐ To change the stack configuration, select Save.
Working with IIS Layer
IIS (Internet Info Services) instance is important while working on AWS Opsworks stacks. When you have successfully installed your recipes, the next step is to verify them with IIS instances.
You can test the recipe by starting and adding an instance to the layer. As soon as the instance has finished booting, AWS OpsWorks Stacks launches install.rb during setup and executes the cookbook installations.
For adding the instances to the layer and starting it:
⭐ Select Instances from the AWS OpsWorks Stacks navigation pane.
⭐ Select Add an instance under the IISExample layer heading.
⭐ Choose the proper size, t2.micro.
⭐ Now, select Add Instance.
⭐ To launch the instance, select start in the Actions column.
The process could take several minutes, and in that time, the Status column will show various statuses. The instance is prepared for use once you reach online status, marking the end of the setup process.
For verifying that IIS is installed and running:
⭐ In the navigation pane, select Instances. In the Actions column of the iisexample1 instance, select rdp.
⭐ Select Generate Password and change the session validity to two hours.
⭐ For your convenience, AWS OpsWorks Stacks also shows the instance's user name and public DNS name, along with the password. Click Acknowledge and close after copying all three.
⭐ Use the information from Step 3 to launch your RDP client and connect to the instance.
⭐ Open Windows Explorer on the instance and look at the C: drive. It should contain the C:\inetpub directory that the IIS installation generated.
⭐ Open Services first, then the Administrative Tools program in the Control Panel. The IIS service ought to be near the bottom of the list. It has the name WWW Publishing Service.
⭐ Go back to the AWS OpsWorks Stacks console and select the public IP address for the iisexample1 instance. To avoid using the Amazon EC2 console, make sure to perform this in AWS OpsWorks Stacks. Automatically sending an HTTP request to that address should launch the IIS Welcome page by default.
Launching the App
Apps are automatically deployed to the new instances but not to running ones. We must manually launch the application.
To launch the app:
⭐ Select App from the navigation pane and then select Deploy from the app's Actions column.
⭐ Set the command to deploy. On the Deploy App page, select Deploy in the lower right corner. It might take a few minutes for the command to complete.
You return to the Apps page once the deployment is complete. A successful deployment is indicated by the Status indicator turning green and the app's name has a green checkmark next to it.
Frequently Asked Questions
From where can I get to the AWS OpsWorks Stacks?
The AWS SDKs, AWS Management Console, and the AWS Command Line Interface all provide access to AWS OpsWorks Stacks.
Are AWS OpsWorks Stacks have any limitations?
Each stack can hold up to 40 instances, 40 layers, and 40 apps by default, and you can create up to 40 stacks altogether.
Which software revision control and versioning systems are supported by AWS OpsWorks Stacks?
The code you want to deploy can be retrieved using AWS OpsWorks Stacks from HTTP, private or public S3 bundles, and popular version control systems like Git and Subversion.
Conclusion
This article briefly discussed AWS Opsworks stacks with Windows. We started our discussion by setting up the AWS Opsworks stack. Afterward, we created a stack, authorized RDP access, and enabled the custom cookbooks in it. At last, we discussed the IIS layer and the steps to launch the app, thus concluding our discussion on AWS Opsworks stacks with Windows.
We hope that this blog has helped you enhance your knowledge about the topic of AWS Opsworks stacks with Windows. If you like to learn more, you can check out our articles:
If you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc. In that case, you must look at the problems, interview experiences, and interview bundles for placement preparations.
Nevertheless, you may consider our paid courses to give your career an edge over others!
Do upvote our blogs if you find them helpful and engaging!