Questions tagged with Windows Provisioning

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

How to run Cloud Formation Init commands in PowerShell and not cmd?

In Coudformation templates, there is a section to specfiy commands like below. Under `fullServer` I am running the command `install`. However, when I look at the logs after cfn has run on the server, it shows ``` 2022-10-20 13:41:25,780 [INFO] Command install succeeded 2022-10-20 13:41:25,796 [DEBUG] Command install output: $MAGIC ``` This is because the `$Magic` is how to declare and use variables in powershell where as cmd needs the `set` keyword. I would expect the output of this command to be `Command install output: I am from the full server env`. ``` "AWS::CloudFormation::Init": { "configSets": { "downloadS3Data": ["downloadS3"], "Full": [{"ConfigSet": "downloadS3Data"}, "fullServer"], "default": [ {"ConfigSet": "Full"}], "App": [{"ConfigSet": "downloadS3Data"}, "appServer"], "Interface": [{"ConfigSet": "downloadS3Data"}, "interfaceServer"], "Notification": [{"ConfigSet": "downloadS3Data"}, "notificationServer"] }, "downloadS3": { "files": { "C:\\ccw_downloads\\test.txt": { "source": "https://ccw-to-rds-poc-1.s3.us-east-2.amazonaws.com/test.txt", "authentication": "S3AccessCreds" } } }, "fullServer": { "commands": { "install": { "command": "echo $MAGIC", "env": {"MAGIC": "I am from the full server env"}, "cwd": "C:\\ccw_downloads", "waitAfterCompletion": 120 } } } } ``` I would like to run the command with PowerShell and not cmd. Is there a way to specify that like I can with User Data? I know that I could append `PowerShell -Command` to the beginning, making cmd call PowerShell and pass args. However, that would not allow me to use the enviornment variable `MAGIC`. For example `"command": "Powershell -Command 'echo $magic'"`
1
answers
0
votes
18
views
asked a month ago

What are cloud best practices for installing software on many EC2 instances that can be configured many ways?

I have a large piece of server software (3 GB of files pre-install) that is running on an EC2. The software installs a full app server or interface server that communicates with the front-end desktop GUIs and database. The software was originally designed years ago to be installed through a visual step-by-step installer off a USB drive on premises. This installer ensures that the software is set up with proper configuration, networking, connection to the database, etc. Every client gets 1 or more EC2 instances dedicated to handle their workload. Moving into a cloud-minded paradigm, what is a better way to handle creating many servers, for many clients, all with different configurations of this software? When a server goes down, or another is needed for load, what's a "cloud" practice to spin up a new server and install the same configuration of software on this server? I have multiple ideas including: 1. Store software files in S3 bucket and pull them to the EC2 instances as necessary. A config file for each customer will also be updated and stored on S3. The EC2 will then start the software from a PowerShell script to create proper configurations. 2. Store the software in the AMI of EC2 exactly as configured. This means any time a server is created with a new client configuration, we create a new AMI after installation. 3. Create a Lambda function that can handle all the different configuration parameters. When invoked, it will take care of spinning up a server, moving the software to the server, and installing the software with proper configuration. Any guidance or references to white papers would be appreciated. Thank you!
1
answers
0
votes
27
views
asked a month ago