Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >ec2-create-vpc "10.0.0.0/16" --region us-west-2
- VPC vpc-27be574c pending 10.0.0.0/16 dopt-c0bc55ab default
- >ec2-create-group web-sg --description "80, 8080, 22 (web y app server)" --vpc vpc-27be574c --region us-west-2
- GROUP sg-0d7f9062 web-sg 80, 8080, 22 (web y app server)
- >ec2-authorize sg-0d7f9062 -P TCP -p 80 -s "0.0.0.0/0"
- PERMISSION ALLOWS tcp 80 80 FROM CIDR 0.0.0.0/0 ingress
- >ec2-authorize sg-0d7f9062 -P TCP -p 8080 -s "0.0.0.0/0"
- GROUP sg-0d7f9062
- PERMISSION ALLOWS tcp 8080 8080 FROM CIDR 0.0.0.0/0 ingress
- >ec2-authorize sg-0d7f9062 -P TCP -p 22 -s "10.0.0.0/16"
- GROUP sg-0d7f9062
- PERMISSION ALLOWS tcp 22 22 FROM CIDR 0.0.0.0/16 ingress
- >ec2-create-subnet --vpc vpc-27be574c -cidr "10.0.0.0/24" --availability-zone us-west-2a --region us-west-2
- SUBNET subnet-15be577e pending vpc-27be574c 10.0.0.0/24 251 us-west-2a
- >ec2-create-subnet --vpc vpc-27be574c -cidr "10.0.1.0/24" --availability-zone us-west-2b --region us-west-2
- SUBNET subnet-e4be578f pending vpc-27be574c 10.0.1.0/24 251 us-west-2b
- >ec2-describe-subnets --region us-west-2
- SUBNET subnet-15be577e available vpc-27be574c 10.0.0.0/24 251 us-west-2a false false
- SUBNET subnet-e4be578f available vpc-27be574c 10.0.1.0/24 251 us-west-2b false false
- >ec2-create-internet-gateway
- INTERNETGATEWAY igw-f69a739d
- >ec2-attach-internet-gateway igw-f69a739d --vpc vpc-27be574c --region us-west-2
- ATTACHMENT vpc-27be574c attaching
- >ec2-create-route-table vpc-27be574c --region us-west-2
- ROUTETABLE rtb-2ddb3146 vpc-27be574c
- ROUTE local active 10.0.0.0/16 CreateRouteTable
- >ec2-create-route rtb-2ddb3146 --cidr 0.0.0.0/0 --gateway igw-f69a739d --region us-west-2
- ROUTE igw-f69a739d 0.0.0.0/0
- >ec2-associate-route-table rtb-2ddb3146 --subnet subnet-15be577e --region us-west-2
- ASSOCIATION rtbassoc-a2d933c9 rtb-2ddb3146 subnet-15be577e
- >ec2-associate-route-table rtb-2ddb3146 --subnet subnet-e4be578f --region us-west-2
- ASSOCIATION rtbassoc-8cd933e7 rtb-2ddb3146 subnet-e4be578f
- >elb-create-lb web-lb --listener "protocol=http, lb-port=80, instance-port=80" --listener "protocol=http, lb-port=8080, instance-port=8080" --subnets "subnet-15be577e" --region us-west-2
- DNS_NAME web-lb-966134185.us-west-2.elb.amazonaws.com
- >elb-describe-lbs --region us-west-2
- LOAD_BALANCER web-lb web-lb-966134185.us-west-2.elb.amazonaws.com 2013-08-13T14:51:19.990Z internet-facing
- >elb-attach-lb-to-subnets web-lb -subnets subnet-e4be578f --region us-west-2
- SUBNETS subnet-15be577e, subnet-e4be578f
- >elb-configure-healthcheck web-lb --target "HTTP:80/" --interval 15 --timeout 10 --unhealthy-threshold 2 --healthy-threshold 2 --region us-west-2
- HEALTH_CHECK HTTP:80/ 15 10 2 2
- >elb-configure-healthcheck web-lb --target "HTTP:8080/" --interval 15 --timeout 10 --unhealthy-threshold 2 --healthy-threshold 2 --region us-west-2
- HEALTH_CHECK HTTP:8080/ 15 10 2 2
- >elb-apply-security-groups-to-lb web-lb --security-groups sg-0d7f9062 --region us-west-2
- SECURITYGROUPS sg-0d7f9062
- >as-create-launch-config webserver-lc --image-id ami-b0b52880 --group sg-0d7f9062 --instance-type m1.small --region us-west-2
- OK-Created launch config
- >as-describe-launch-configs --region us-west-2
- LAUNCH-CONFIG webserver-lc ami-b0b52880 m1.small
- >as-create-auto-scaling-group web-asg --min-size 1 --max-size 3 --default-cooldown 300 --grace-period 100 --health-check-type ELB --launch-configuration webserver-lc --load-balancers web-lb --vpc-zone-identifier "subnet-15be577e, subnet-e4be578f" --region us-west-2
- OK-Created AutoScalingGroup
- >elb-describe-lbs --region us-west-2
- LOAD_BALANCER web-lb web-lb-966134185.us-west-2.elb.amazonaws.com 2013-08-13T14:51:19.990Z internet-facing
- C:\Users\ciberado
- >as-describe-scaling-activities --region us-west-2
- No activities found
- C:\Users\ciberado
- >as-describe-scaling-activities --region us-west-2
- ACTIVITY d4fd8aef-2c78-4481-9b17-a41d776477f7 web-asg PreInService
- >sns-create-topic webasg-change --region us-west-2
- arn:aws:sns:us-west-2:562397084151:webasg-change
- >sns-subscribe arn:aws:sns:us-west-2:562397084151:webasg-change --protocol email --endpoint email@company.com --region us-west-2
- Subscription request received.
- (check email and click on the link)
- Your subscription's id is:
- arn:aws:sns:us-west-2:562397084151:webasg-change:5352f5c5-ecf8-49cc-b47a-04ab3d714027
- >as-describe-auto-scaling-notification-types
- NOTIFICATION-TYPE autoscaling:EC2_INSTANCE_LAUNCH
- NOTIFICATION-TYPE autoscaling:EC2_INSTANCE_LAUNCH_ERROR
- NOTIFICATION-TYPE autoscaling:EC2_INSTANCE_TERMINATE
- NOTIFICATION-TYPE autoscaling:EC2_INSTANCE_TERMINATE_ERROR
- NOTIFICATION-TYPE autoscaling:TEST_NOTIFICATION
- >as-put-notification-configuration web-asg --topic-arn arn:aws:sns:us-west-2:562397084151:webasg-change --notification-types autoscaling:EC2_INSTANCE_LAUNCH, autoscaling:EC2_INSTANCE_LAUNCH_ERROR, autoscaling:EC2_INSTANCE_TERMINATE, autoscaling:EC2_INSTANCE_TERMINATE_ERROR, autoscaling:TEST_NOTIFICATION --region us-west-2
- >as-put-scaling-policy webup-sp --type ChangeInCapacity --adjustment=1 --cooldown=200 --auto-scaling-group web-asg --region us-west-2
- arn:aws:autoscaling:us-west-2:562397084151:scalingPolicy:6f0b8f13-c9e0-4509-aba0-506b89dff5dc:autoScalingGroupName/web-asg:policyName/webup-sp
- >as-put-scaling-policy webdn-sp --type ChangeInCapacity "--adjustment=-1" --cooldown=200 --auto-scaling-group web-asg --region us-west-2
- arn:aws:autoscaling:us-west-2:562397084151:scalingPolicy:1d7dd0d0-483e-4be0-81de-186e4018cff5:autoScalingGroupName/web-asg:policyName/webdn-sp
- >mon-put-metric-alarm highCPU-a --comparison-operator GreaterThanThreshold --evaluation-periods 1 --metric-name CPUUtilization --namespace "AWS/EC2" --period 120 --threshold 85 --alarm-actions arn:aws:autoscaling:us-west-2:562397084151:scalingPolicy:6f0b8f13-c9e0-4509-aba0-506b89dff5dc:autoScalingGroupName/web-asg:policyName/webup-sp --dimensions "AutoScalingGroupName=web-asg" -statistic Average --region us-west-2
- OK-Created Alarm
- está activado.
- >mon-put-metric-alarm lowCPU-a --comparison-operator LessThanThreshold --evaluation-periods 1 --metric-name CPUUtilization --namespace "AWS/EC2" --period 120 --threshold 40 --alarm-actions arn:aws:autoscaling:us-west-2:562397084151:scalingPolicy:1d7dd0d0-483e-4be0-81de-186e4018cff5:autoScalingGroupName/web-asg:policyName/webdn-sp --dimensions "AutoScalingGroupName=web-asg" -statistic Average --region us-west-2
- OK-Created Alarm
- está activado.
- >mon-describe-alarms --region us-west-2
- highCPU-a OK arn:aws:autoscalin...policyName/webup-sp AWS/EC2 CPUUtilization 120 Average 1 GreaterThanThreshold 85.0
- lowCPU-a ALARM arn:aws:autoscalin...policyName/webdn-sp AWS/EC2 CPUUtilization 120 Average 1 LessThanThreshold 40.0
- está activado.
- >mon-delete-alarms HighCPU-a, LowCPU-a --region us-west-2
- OK-Deleted alarms
- está activado.
- >as-delete-policy webdn-sp --auto-scaling-group web-asg --region us-west-2
- OK-Deleted Policy
- >as-delete-policy webup-sp --auto-scaling-group web-asg --region us-west-2
- OK-Deleted Policy
- >as-delete-notification-configuration web-asg --topic-arn arn:aws:sns:us-west-2:562397084151:webasg-change --region us-west-2
- OK-Deleted Notification Configuration
- >sns-delete-topic arn:aws:sns:us-west-2:562397084151:webasg-change --region us-west-2
- Topic deleted.
- >as-update-auto-scaling-group web-asg --min-size 0 --max-size 0 --desired-capcity 0 --region us-west-2
- OK-Updated AutoScalingGroup
- >as-delete-auto-scaling-group web-asg --region us-west-2
- OK-Deleted AutoScalingGroup
- >as-delete-launch-config webserver-lc --region us-west-2
- OK-Deleted launch configuration
- ERRORES:
- >elb-detach-lb-from-subnets web-lb --subnets "subnet-15be577e, subnet-e4be578f" --region us-west-2
- elb-detach-lb-from-subnets: program error
- >elb-delete-lb web-lb --region us-west-2
- elb-delete-lb: program error
- OK, after removing it with the console.
- (TODO: remove the rest of the created resources)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement