I hereby claim:
- I am stewmi on github.
- I am stewmi (https://keybase.io/stewmi) on keybase.
- I have a public key ASAq85J6b-0_-6EYEZjBp5VZc19xTTiWppB1PR6iVJHysAo
To claim this, I am signing this object:
| import boto3 | |
| import json | |
| orgs = boto3.client("organizations") | |
| paginator = orgs.get_paginator('list_policies') | |
| page_iterator = paginator.paginate(Filter="SERVICE_CONTROL_POLICY") | |
| for page in page_iterator: | |
| for policy in page['Policies']: |
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: A Template | |
| Parameters: | |
| KeyName: | |
| Description: Name of an existing EC2 KeyPair to enable SSH access to the instance | |
| Type: String | |
| Mappings: | |
| RegionMap: | |
| us-east-1: | |
| AMI: ami-76f0061f |
| import boto3 | |
| import botocore | |
| cfn = boto3.client("cloudformation") | |
| try: | |
| stack_status = cfn.describe_stacks(StackName="test123") | |
| except botocore.exceptions.ClientError as error: | |
| if error.response['Error']['Code'] == "ValidationError": | |
| print("Stack Not Found") |
| import boto3 | |
| import argparse | |
| ec2 = boto3.client('ec2') | |
| DEFAULT_INSTANCE_PROFILE = "" | |
| DEFAULT_LT_NAME = "" | |
| def create_lt_version(lt_name, iam_instance_profile): | |
| ''' |
I hereby claim:
To claim this, I am signing this object:
| import argparse | |
| import boto3 | |
| s3 = boto3.client('s3') | |
| def get_file(bucket, file): | |
| s3.download_file(bucket, file, file) | |
| return |
| response = sts.assume_role( | |
| RoleArn=ORGS_ROLE, | |
| RoleSessionName="OrgsListRole" | |
| ) | |
| session = boto3.Session( | |
| aws_access_key_id=response['Credentials']['AccessKeyId'], | |
| aws_secret_access_key=response['Credentials']['SecretAccessKey'], | |
| aws_session_token=response['Credentials']['SessionToken'] | |
| ) | |
| organizations = session.client('organizations', region_name="us-east-1") |
| import boto3 | |
| # Create a client | |
| client = boto3.client('s3', region_name='us-west-2') | |
| # Create a reusable Paginator | |
| paginator = client.get_paginator('list_objects') | |
| # Create a PageIterator from the Paginator | |
| page_iterator = paginator.paginate(Bucket='my-bucket') |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| try: | |
| iam = boto3.client('iam') | |
| user = iam.create_user(UserName='fred') | |
| print("Created user: %s" % user) | |
| except ClientError as e: | |
| if e.response['Error']['Code'] == 'EntityAlreadyExists': | |
| print("User already exists") |
| [user] | |
| name = Mike Steward | |
| email = [email protected] | |
| [color] | |
| ui = true | |
| diff = auto | |
| showbranch = auto | |
| branch = auto | |
| status = auto | |
| [color "branch"] |