assume-cloudformation-role

Assume AWS IAM role for CloudFormation operations and set temporary credentials as environment variables. Use when working with CloudFormation stacks or when authentication setup is needed before AWS CloudFormation operations.

16 stars

Best use case

assume-cloudformation-role is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Assume AWS IAM role for CloudFormation operations and set temporary credentials as environment variables. Use when working with CloudFormation stacks or when authentication setup is needed before AWS CloudFormation operations.

Teams using assume-cloudformation-role should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/assume-cloudformation-role/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/assume-cloudformation-role/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/assume-cloudformation-role/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How assume-cloudformation-role Compares

Feature / Agentassume-cloudformation-roleStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Assume AWS IAM role for CloudFormation operations and set temporary credentials as environment variables. Use when working with CloudFormation stacks or when authentication setup is needed before AWS CloudFormation operations.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Assume CloudFormation Write Role

A skill to obtain the necessary credentials for AWS CloudFormation stack operations (create, delete, update) and set them as environment variables.

## Purpose

Before CloudFormation operations, assume the specified role to obtain temporary credentials and set them as environment variables that can be used by AWS CLI.

## Input Parameters

- `profile`: AWS CLI profile name (default: `web-hosting`)
- `role_arn`: IAM role ARN to assume (default: `arn:aws:iam::692859919890:role/CloudFormationWriteRole`)
- `role_session_name`: Session name (default: `cfn-write`)

## Execution Steps

1. Use AWS STS to assume the role and obtain credentials
2. Save credentials to a temporary file
3. Parse credentials using jq and set as environment variables
4. Clean up the temporary file

## Command Example

```bash
# Assume role and obtain credentials
aws sts assume-role \
  --role-arn arn:aws:iam::692859919890:role/CloudFormationWriteRole \
  --role-session-name cfn-write \
  --profile web-hosting \
  > /tmp/creds.json

# Set environment variables
export AWS_ACCESS_KEY_ID=$(jq -r '.Credentials.AccessKeyId' /tmp/creds.json)
export AWS_SECRET_ACCESS_KEY=$(jq -r '.Credentials.SecretAccessKey' /tmp/creds.json)
export AWS_SESSION_TOKEN=$(jq -r '.Credentials.SessionToken' /tmp/creds.json)

# Remove temporary file
rm /tmp/creds.json
```

## Output

Environment variables are set, making CloudFormation operations available via AWS CLI:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_SESSION_TOKEN`

## Usage Examples

After executing this skill, the following CloudFormation commands become available:

```bash
# Create stack
aws cloudformation create-stack --stack-name my-stack --template-body file://template.yaml

# Update stack
aws cloudformation update-stack --stack-name my-stack --template-body file://template.yaml

# Delete stack
aws cloudformation delete-stack --stack-name my-stack
```

## Prerequisites

- AWS CLI installed
- jq command installed
- Specified profile (default: `web-hosting`) configured in `~/.aws/credentials` or `~/.aws/config`
- Source profile has `sts:AssumeRole` permission for the specified role

## Notes

- Credentials are temporary and typically expire after 1 hour
- If credentials expire, re-execute this skill
- For security purposes, temporary files are always deleted after processing

Related Skills

aws-cloudformation-security

16
from diegosouzapw/awesome-omni-skill

Provides AWS CloudFormation patterns for infrastructure security, secrets management, encryption, and secure data handling. Use when creating secure CloudFormation templates with AWS Secrets Manager, KMS encryption, secure parameters, IAM policies, VPC security groups, TLS/SSL certificates, and encrypted traffic configurations. Covers template structure, parameter best practices, cross-stack references, and defense-in-depth strategies.

aws-cloudformation-elasticache

16
from diegosouzapw/awesome-omni-skill

AWS CloudFormation patterns for Amazon ElastiCache. Use when creating ElastiCache clusters (Redis, Memcached), replication groups, parameter groups, subnet groups, and implementing template structure with Parameters, Outputs, Mappings, Conditions, and cross-stack references for distributed caching infrastructure.

aws-cloudformation-cloudfront

16
from diegosouzapw/awesome-omni-skill

AWS CloudFormation patterns for CloudFront distributions, origins (ALB, S3, Lambda@Edge, VPC Origins), CacheBehaviors, Functions, SecurityHeaders, parameters, Outputs and cross-stack references. Use when creating CloudFront distributions with CloudFormation, configuring multiple origins, implementing caching strategies, managing custom domains with ACM, configuring WAF, and optimizing performance.

ansible-roles

16
from diegosouzapw/awesome-omni-skill

Use when structuring and reusing code with Ansible roles for modular, maintainable automation and configuration management.

ansible-role-init

16
from diegosouzapw/awesome-omni-skill

Scaffold a new Ansible role via ansible-galaxy init

naiba-openai-any-role

16
from diegosouzapw/awesome-omni-skill

Learn how to use ChatGPT for any work role with universal use cases | Part of naiba-openai-work-assistant

agent-roles-core

16
from diegosouzapw/awesome-omni-skill

Core agent role definitions and responsibilities used across repositories.

aws-cloudformation-rds

16
from diegosouzapw/awesome-omni-skill

AWS CloudFormation patterns for Amazon RDS databases. Use when creating RDS instances (MySQL, PostgreSQL, Aurora), DB clusters, multi-AZ deployments, parameter groups, subnet groups, and implementing template structure with Parameters, Outputs, Mappings, Conditions, and cross-stack references.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

bio-liquid-biopsy-pipeline

16
from diegosouzapw/awesome-omni-skill

Cell-free DNA analysis pipeline from plasma sequencing to tumor monitoring. Preprocesses cfDNA reads, analyzes fragment patterns, estimates tumor fraction from sWGS, and optionally detects mutations from targeted panels. Use when analyzing liquid biopsy samples for cancer detection or monitoring.

bicep

16
from diegosouzapw/awesome-omni-skill

Expert assistance for Azure Bicep infrastructure-as-code. Provides best practices for authoring Bicep templates, Azure resource type discovery with API versions, resource schema retrieval, and Azure Verified Modules (AVM) guidance. Use when writing Bicep files, deploying Azure resources, looking up resource types/schemas, or working with AVM modules.

bicep-diagrams

16
from diegosouzapw/awesome-omni-skill

Generates architecture diagrams from Azure Bicep files. Use when user has .bicep files or asks to visualize Bicep infrastructure.