close
Amazon Web Services (AWS)

Write a script to list active directories in AWS

Here’s an example of a bash script that lists the active directories in an AWS account using the AWS CLI:

#!/bin/bash

# Set the AWS CLI region
aws configure set default.region us-west-2

# Get a list of all the active directories in the AWS account
active_directories=$(aws ds describe-directories --query 'DirectoryDescriptions[].Name' --output text)

# Loop through the list of active directories
for directory in $active_directories; do
  # Print the name of each active directory
  echo $directory
done

In this example, the AWS CLI is used to retrieve a list of all the active directories in the AWS account, and the bash script loops through that list, printing the name of each active directory. You can modify this script to fit your specific needs, such as filtering the list of active directories based on certain criteria.

read more
Amazon Web Services (AWS)

How to automate Amazon AppStream 2.0 image deployment

https://aws.amazon.com/blogs/desktop-and-application-streaming/how-to-automate-amazon-appstream-2-0-image-deployment/

This article describes a step-by-step guide for automating the deployment of Amazon AppStream 2.0 images to existing fleets. The process involves creating an IAM policy, IAM role, AWS Lambda function, AWS Step Functions state machine, and Amazon EventBridge rule. The IAM policy and role provide the necessary permissions for the Lambda function to manage the image update process. The Lambda function checks the key-value of tagged AppStream 2.0 resources and starts the image update process. The state machine deploys the image and any scaling actions during the defined maintenance window. The EventBridge rule triggers the Lambda function every time an AppStream 2.0 resource is tagged. The process notifies administrators of the image deployment status using Amazon Simple Email Service.

read more
1 2 3 4 5
Page 2 of 5