Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?
title = "TOML Example" |
| { | |
| "APIGatewayServiceRolePolicy": { | |
| "Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy", | |
| "AttachmentCount": 1, | |
| "CreateDate": "2018-08-10T17:57:44+00:00", | |
| "DefaultVersionId": "v3", | |
| "Document": { | |
| "Statement": [ | |
| { | |
| "Action": [ |
| import boto3 | |
| def role_arn_to_session(**args): | |
| """ | |
| Usage : | |
| session = role_arn_to_session( | |
| RoleArn='arn:aws:iam::012345678901:role/example-role', | |
| RoleSessionName='ExampleSessionName') | |
| client = session.client('sqs') | |
| """ |
| import boto3 | |
| codecommit = boto3.client('codecommit') | |
| codebuild = boto3.client('codebuild') | |
| def trigger_build(project, commit, branch): | |
| codebuild.start_build(projectName=project, sourceVersion=commit, | |
| environmentVariablesOverride=[ | |
| { 'name': 'ENVIRONMENT', 'value': branch, 'type': 'PLAINTEXT' } | |
| ]) |
| import json | |
| import boto3 | |
| import paramiko | |
| def worker_handler(event, context): | |
| ALLOWED_HOSTS = [ | |
| 'host1', | |
| 'host2, |
| --- | |
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: "Create a Lambda function that will take a comma seperated list of key=value pairs and return an array of key value pairs that can then be used in cloudformation tags resource parameter" | |
| Resources: | |
| LambdaExecutionRole: | |
| Type: AWS::IAM::Role | |
| Properties: | |
| ManagedPolicyArns: | |
| - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole |
Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?
title = "TOML Example" |
| """Ansible dict filters.""" | |
| # Make coding more python3-ish | |
| from __future__ import (absolute_import, division, print_function) | |
| __metaclass__ = type | |
| from ansible.errors import AnsibleError | |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| # Find the IAM username belonging to the TARGET_ACCESS_KEY | |
| # Useful for finding IAM user corresponding to a compromised AWS credential | |
| # Requirements: | |
| # | |
| # Environmental variables: | |
| # AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | |
| # python: | |
| # boto |