# NOT RUN {
# This example registers a scalable target from an Amazon ECS service
# called web-app that is running on the default cluster, with a minimum
# desired count of 1 task and a maximum desired count of 10 tasks.
# }
# NOT RUN {
svc$register_scalable_target(
MaxCapacity = 10L,
MinCapacity = 1L,
ResourceId = "service/default/web-app",
RoleARN = "arn:aws:iam::012345678910:role/ApplicationAutoscalingECSRole",
ScalableDimension = "ecs:service:DesiredCount",
ServiceNamespace = "ecs"
)
# }
# NOT RUN {
# This example registers a scalable target from an Amazon EC2 Spot fleet
# with a minimum target capacity of 1 and a maximum of 10.
# }
# NOT RUN {
svc$register_scalable_target(
MaxCapacity = 10L,
MinCapacity = 1L,
ResourceId = "spot-fleet-request/sfr-45e69d8a-be48-4539-bbf3-3464e99c50c3",
RoleARN = "arn:aws:iam::012345678910:role/ApplicationAutoscalingSpotRole",
ScalableDimension = "ec2:spot-fleet-request:TargetCapacity",
ServiceNamespace = "ec2"
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab