404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.223.149.135: ~ $
**Example 1: To create an Auto Scaling group**

The following ``create-auto-scaling-group`` example creates an Auto Scaling group in subnets in multiple Availability Zones within a Region. The instances launch with the default version of the specified launch template. Note that defaults are used for most other settings, such as the termination policies and health check configuration. ::

    aws autoscaling create-auto-scaling-group \
        --auto-scaling-group-name my-asg \
        --launch-template LaunchTemplateId=lt-1234567890abcde12 \
        --min-size 1 \
        --max-size 5 \
        --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"

This command produces no output.

For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.

**Example 2: To attach an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer**

This example specifies the ARN of a target group for a load balancer that supports the expected traffic. The health check type specifies ``ELB`` so that when Elastic Load Balancing reports an instance as unhealthy, the Auto Scaling group replaces it. The command also defines a health check grace period of ``600`` seconds. The grace period helps prevent premature termination of newly launched instances. ::

    aws autoscaling create-auto-scaling-group \
        --auto-scaling-group-name my-asg \
        --launch-template LaunchTemplateId=lt-1234567890abcde12 \
        --target-group-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/943f017f100becff \
        --health-check-type ELB \
        --health-check-grace-period 600 \
        --min-size 1 \
        --max-size 5 \
        --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"

This command produces no output.

For more information, see `Elastic Load Balancing and Amazon EC2 Auto Scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.

**Example 3: To specify a placement group and use the latest version of the launch template**

This example launches instances into a placement group within a single Availability Zone. This can be useful for low-latency groups with HPC workloads. This example also specifies the minimum size, maximum size, and desired capacity of the group. ::

    aws autoscaling create-auto-scaling-group \
        --auto-scaling-group-name my-asg \
        --launch-template LaunchTemplateId=lt-1234567890abcde12,Version='$Latest' \
        --min-size 1 \
        --max-size 5 \
        --desired-capacity 3 \
        --placement-group my-placement-group \
        --vpc-zone-identifier "subnet-6194ea3b"

This command produces no output.

For more information, see `Placement groups <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html>`__ in the *Amazon EC2 User Guide for Linux Instances*.

**Example 4: To specify a single instance Auto Scaling group and use a specific version of the launch template**

This example creates an Auto Scaling group with minimum and maximum capacity set to ``1`` to enforce that one instance will be running. The command also specifies v1 of a launch template in which the ID of an existing ENI is specified. When you use a launch template that specifies an existing ENI for eth0, you must specify an Availability Zone for the Auto Scaling group that matches the network interface, without also specifying a subnet ID in the request. ::

    aws autoscaling create-auto-scaling-group \
        --auto-scaling-group-name my-asg-single-instance \
        --launch-template LaunchTemplateName=my-template-for-auto-scaling,Version='1' \
        --min-size 1 \
        --max-size 1 \
        --availability-zones us-west-2a

This command produces no output.

For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.

**Example 5: To specify a different termination policy**

This example creates an Auto Scaling group using a launch configuration and sets the termination policy to terminate the oldest instances first. The command also applies a tag to the group and its instances, with a key of ``Role`` and a value of ``WebServer``. ::

    aws autoscaling create-auto-scaling-group \
        --auto-scaling-group-name my-asg \
        --launch-configuration-name my-lc \
        --min-size 1 \
        --max-size 5 \
        --termination-policies "OldestInstance" \
        --tags "ResourceId=my-asg,ResourceType=auto-scaling-group,Key=Role,Value=WebServer,PropagateAtLaunch=true" \
        --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"

This command produces no output.

For more information, see `Working with Amazon EC2 Auto Scaling termination policies <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.

**Example 6: To specify a launch lifecycle hook**

This example creates an Auto Scaling group with a lifecycle hook that supports a custom action at instance launch. ::

    aws autoscaling create-auto-scaling-group \
        --cli-input-json file://~/config.json

Contents of ``config.json`` file::

    {
        "AutoScalingGroupName": "my-asg",
        "LaunchTemplate": {
            "LaunchTemplateId": "lt-1234567890abcde12"
        },
        "LifecycleHookSpecificationList": [{
            "LifecycleHookName": "my-launch-hook",
            "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING",
            "NotificationTargetARN": "arn:aws:sqs:us-west-2:123456789012:my-sqs-queue",
            "RoleARN": "arn:aws:iam::123456789012:role/my-notification-role",
            "NotificationMetadata": "SQS message metadata",
            "HeartbeatTimeout": 4800,
            "DefaultResult": "ABANDON"
        }],
        "MinSize": 1,
        "MaxSize": 5,
        "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782",
        "Tags": [{
            "ResourceType": "auto-scaling-group",
            "ResourceId": "my-asg",
            "PropagateAtLaunch": true,
            "Value": "test",
            "Key": "environment"
        }]
    }

This command produces no output.

For more information, see `Amazon EC2 Auto Scaling lifecycle hooks <https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.

**Example 7: To specify a termination lifecycle hook**

This example creates an Auto Scaling group with a lifecycle hook that supports a custom action at instance termination. ::

    aws autoscaling create-auto-scaling-group \
        --cli-input-json file://~/config.json

Contents of ``config.json``::

    {
        "AutoScalingGroupName": "my-asg",
        "LaunchTemplate": {
            "LaunchTemplateId": "lt-1234567890abcde12"
        },
        "LifecycleHookSpecificationList": [{
            "LifecycleHookName": "my-termination-hook",
            "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING",
            "HeartbeatTimeout": 120,
            "DefaultResult": "CONTINUE"
        }],
        "MinSize": 1,
        "MaxSize": 5,
        "TargetGroupARNs": [
            "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
        ],
        "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"
    }

This command produces no output.

For more information, see `Amazon EC2 Auto Scaling lifecycle hooks <https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.

**Example 8: To specify a custom termination policy**

This example creates an Auto Scaling group that specifies a custom Lambda function termination policy that tells Amazon EC2 Auto Scaling which instances are safe to terminate on scale in. ::

    aws autoscaling create-auto-scaling-group \
        --auto-scaling-group-name my-asg-single-instance \
        --launch-template LaunchTemplateName=my-template-for-auto-scaling \
        --min-size 1 \
        --max-size 5 \
        --termination-policies "arn:aws:lambda:us-west-2:123456789012:function:HelloFunction:prod" \    
        --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"

This command produces no output.

For more information, see `Creating a custom termination policy with Lambda <https://docs.aws.amazon.com/autoscaling/ec2/userguide/lambda-custom-termination-policy.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.

Filemanager

Name Type Size Permission Actions
attach-instances.rst File 306 B 0644
attach-load-balancer-target-groups.rst File 622 B 0755
attach-load-balancers.rst File 554 B 0644
cancel-instance-refresh.rst File 545 B 0644
complete-lifecycle-action.rst File 690 B 0644
create-auto-scaling-group.rst File 8.71 KB 0644
create-launch-configuration.rst File 7.03 KB 0644
create-or-update-tags.rst File 619 B 0644
delete-auto-scaling-group.rst File 1006 B 0644
delete-launch-configuration.rst File 445 B 0644
delete-lifecycle-hook.rst File 263 B 0644
delete-notification-configuration.rst File 573 B 0644
delete-policy.rst File 270 B 0644
delete-scheduled-action.rst File 338 B 0644
delete-tags.rst File 496 B 0644
delete-warm-pool.rst File 961 B 0644
describe-account-limits.rst File 596 B 0644
describe-adjustment-types.rst File 700 B 0644
describe-auto-scaling-groups.rst File 3.61 KB 0644
describe-auto-scaling-instances.rst File 2.01 KB 0644
describe-auto-scaling-notification-types.rst File 745 B 0644
describe-instance-refreshes.rst File 2.21 KB 0644
describe-launch-configurations.rst File 2.46 KB 0644
describe-lifecycle-hook-types.rst File 345 B 0644
describe-lifecycle-hooks.rst File 972 B 0644
describe-load-balancer-target-groups.rst File 570 B 0755
describe-load-balancers.rst File 443 B 0644
describe-metric-collection-types.rst File 1.57 KB 0644
describe-notification-configurations.rst File 2.49 KB 0644
describe-policies.rst File 4.7 KB 0644
describe-scaling-activities.rst File 4.95 KB 0644
describe-scaling-process-types.rst File 1.11 KB 0644
describe-scheduled-actions.rst File 6.92 KB 0644
describe-tags.rst File 1.96 KB 0644
describe-termination-policy-types.rst File 727 B 0644
describe-warm-pool.rst File 1.56 KB 0644
detach-instances.rst File 1015 B 0644
detach-load-balancer-target-groups.rst File 654 B 0755
detach-load-balancers.rst File 559 B 0644
disable-metrics-collection.rst File 581 B 0644
enable-metrics-collection.rst File 1.11 KB 0644
enter-standby.rst File 1.25 KB 0644
execute-policy.rst File 578 B 0644
exit-standby.rst File 1.15 KB 0644
put-lifecycle-hook.rst File 2.5 KB 0644
put-notification-configuration.rst File 637 B 0644
put-scaling-policy.rst File 1.94 KB 0644
put-scheduled-update-group-action.rst File 1.54 KB 0644
put-warm-pool.rst File 509 B 0644
record-lifecycle-action-heartbeat.rst File 596 B 0644
resume-processes.rst File 518 B 0644
rollback-instance-refresh.rst File 559 B 0644
set-desired-capacity.rst File 341 B 0644
set-instance-health.rst File 290 B 0644
set-instance-protection.rst File 714 B 0644
start-instance-refresh.rst File 1.96 KB 0644
suspend-processes.rst File 514 B 0644
terminate-instance-in-auto-scaling-group.rst File 1005 B 0644
update-auto-scaling-group.rst File 4.9 KB 0644