My First troposphere code to create instance (sample)

Below is the troposphere library which is used to convert the python script to json and yaml formats which avoids writing of clouformation 🙂   from troposphere import Ref, Template import troposphere.ec2 as ec2 t = Template() instance = ec2.Instance(“myinstance”) instance.ImageId = “ami-951945d0” instance.InstanceType = “t1.micro” t.add_resource(instance) with open(‘jaml.yaml’, ‘w’) as f:    // command… Continue reading My First troposphere code to create instance (sample)

commands in terraform

Terraform cmds  which I used:   export AWS_ACCOUNT=071137033942 export AWS_PROFILE=bis-dev export AWS_REGION=us-east-1   export ENV=[devops|dev|test|qa] export REGION=us1   export TF_STATE_BUCKET=”bis-config-$AWS_REGION-$AWS_ACCOUNT” export TF_STATE_KEY=”terraform/bis/bis-$ENV-$REGION.tfstate” export TF_LOCK_TABLE=”bis-$ENV-tf-state-lock-$REGION”   cd bis-$ENV-$REGION   terraform init \ -lock=”true” \ -backend-config=”bucket=$TF_STATE_BUCKET” \ -backend-config=”key=$TF_STATE_KEY” \ -backend-config=”dynamodb_table=$TF_LOCK_TABLE” \ -backend-config=”profile=$AWS_PROFILE” \ -backend-config=”region=$AWS_REGION” \ -backend-config=”encrypt=true” \ ..   terraform get -update=true .. terraform refresh .. terraform… Continue reading commands in terraform

Sample IAM Ploicy for multiple

{ “Version”: “2012-10-17”, “Statement”: [ { “Sid”: “Read access through console”, “Effect”: “Allow”, “Action”: [ “datapipeline:ListPipelines”, “datapipeline:GetAccountLimits”, “cloudwatch:*”, “dynamodb:DescribeTable”, “elasticmapreduce:AddJobFlowSteps”, “elasticmapreduce:ListInstance*”, “iam:AddRoleToInstanceProfile”, “iam:CreateInstanceProfile”, “iam:GetInstanceProfile”, “iam:GetRole”, “iam:ListInstanceProfiles”, “iam:ListInstanceProfilesForRole”, “iam:ListRoles”, “iam:PassRole”, “rds:DescribeDBInstances”, “rds:DescribeDBSecurityGroups”, “redshift:DescribeClusters”, “redshift:DescribeClusterSecurityGroups”, “s3:List*”, “sns:ListTopics” ], “Resource”: [ “*” ] }, { “Sid”: “Write access to user’s own DataPipelines”, “Effect”: “Allow”, “Action”: [ “datapipeline:*” ],… Continue reading Sample IAM Ploicy for multiple