launch_configurations
Creates, updates, deletes or gets a launch_configuration resource or lists launch_configurations in a region
Overview
| Name | launch_configurations |
| Type | Resource |
| Description | The AWS::AutoScaling::LaunchConfiguration resource specifies the launch configuration that can be used by an Auto Scaling group to configure Amazon EC2 instances. |
| Id | awscc.autoscaling.launch_configurations |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
placement_tenancy | string | The tenancy of the instance, either default or dedicated. |
security_groups | array | A list that contains the security groups to assign to the instances in the Auto Scaling group. |
launch_configuration_name | string | The name of the launch configuration. This name must be unique per Region per account. |
metadata_options | object | The metadata options for the instances. |
instance_id | string | The ID of the Amazon EC2 instance you want to use to create the launch configuration. |
user_data | string | The Base64-encoded user data to make available to the launched EC2 instances. |
classic_link_vpc_security_groups | array | The IDs of one or more security groups for the VPC that you specified in the ClassicLinkVPCId property. |
block_device_mappings | array | Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes. |
iam_instance_profile | string | Provides the name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. |
kernel_id | string | Provides the ID of the kernel associated with the EC2 AMI. |
associate_public_ip_address | boolean | For Auto Scaling groups that are running in a virtual private cloud (VPC), specifies whether to assign a public IP address to the group's instances. |
classic_link_vpc_id | string | The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. |
ebs_optimized | boolean | Specifies whether the launch configuration is optimized for EBS I/O (true) or not (false). |
key_name | string | Provides the name of the EC2 key pair. |
spot_price | string | The maximum hourly price you are willing to pay for any Spot Instances launched to fulfill the request. |
image_id | string | Provides the unique ID of the Amazon Machine Image (AMI) that was assigned during registration. |
instance_type | string | Specifies the instance type of the EC2 instance. |
ram_disk_id | string | The ID of the RAM disk to select. |
instance_monitoring | boolean | Controls whether instances in this group are launched with detailed (true) or basic (false) monitoring. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
launch_configuration_name | string | The name of the launch configuration. This name must be unique per Region per account. |
region | string | AWS region. |
For more information, see AWS::AutoScaling::LaunchConfiguration.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | launch_configurations | INSERT | ImageId, InstanceType, region |
delete_resource | launch_configurations | DELETE | Identifier, region |
list_resources | launch_configurations_list_only | SELECT | region |
get_resource | launch_configurations | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual launch_configuration.
SELECT
region,
placement_tenancy,
security_groups,
launch_configuration_name,
metadata_options,
instance_id,
user_data,
classic_link_vpc_security_groups,
block_device_mappings,
iam_instance_profile,
kernel_id,
associate_public_ip_address,
classic_link_vpc_id,
ebs_optimized,
key_name,
spot_price,
image_id,
instance_type,
ram_disk_id,
instance_monitoring
FROM awscc.autoscaling.launch_configurations
WHERE
region = '{{ region }}' AND
Identifier = '{{ launch_configuration_name }}';
Lists all launch_configurations in a region.
SELECT
region,
launch_configuration_name
FROM awscc.autoscaling.launch_configurations_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new launch_configuration resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.autoscaling.launch_configurations (
ImageId,
InstanceType,
region
)
SELECT
'{{ image_id }}',
'{{ instance_type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.autoscaling.launch_configurations (
PlacementTenancy,
SecurityGroups,
LaunchConfigurationName,
MetadataOptions,
InstanceId,
UserData,
ClassicLinkVPCSecurityGroups,
BlockDeviceMappings,
IamInstanceProfile,
KernelId,
AssociatePublicIpAddress,
ClassicLinkVPCId,
EbsOptimized,
KeyName,
SpotPrice,
ImageId,
InstanceType,
RamDiskId,
InstanceMonitoring,
region
)
SELECT
'{{ placement_tenancy }}',
'{{ security_groups }}',
'{{ launch_configuration_name }}',
'{{ metadata_options }}',
'{{ instance_id }}',
'{{ user_data }}',
'{{ classic_link_vpc_security_groups }}',
'{{ block_device_mappings }}',
'{{ iam_instance_profile }}',
'{{ kernel_id }}',
'{{ associate_public_ip_address }}',
'{{ classic_link_vpc_id }}',
'{{ ebs_optimized }}',
'{{ key_name }}',
'{{ spot_price }}',
'{{ image_id }}',
'{{ instance_type }}',
'{{ ram_disk_id }}',
'{{ instance_monitoring }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: launch_configuration
props:
- name: placement_tenancy
value: '{{ placement_tenancy }}'
- name: security_groups
value:
- '{{ security_groups[0] }}'
- name: launch_configuration_name
value: '{{ launch_configuration_name }}'
- name: metadata_options
value:
http_put_response_hop_limit: '{{ http_put_response_hop_limit }}'
http_tokens: '{{ http_tokens }}'
http_endpoint: '{{ http_endpoint }}'
- name: instance_id
value: '{{ instance_id }}'
- name: user_data
value: '{{ user_data }}'
- name: classic_link_vpc_security_groups
value:
- '{{ classic_link_vpc_security_groups[0] }}'
- name: block_device_mappings
value:
- ebs:
snapshot_id: '{{ snapshot_id }}'
volume_type: '{{ volume_type }}'
encrypted: '{{ encrypted }}'
throughput: '{{ throughput }}'
iops: '{{ iops }}'
volume_size: '{{ volume_size }}'
delete_on_termination: '{{ delete_on_termination }}'
no_device: '{{ no_device }}'
virtual_name: '{{ virtual_name }}'
device_name: '{{ device_name }}'
- name: iam_instance_profile
value: '{{ iam_instance_profile }}'
- name: kernel_id
value: '{{ kernel_id }}'
- name: associate_public_ip_address
value: '{{ associate_public_ip_address }}'
- name: classic_link_vpc_id
value: '{{ classic_link_vpc_id }}'
- name: ebs_optimized
value: '{{ ebs_optimized }}'
- name: key_name
value: '{{ key_name }}'
- name: spot_price
value: '{{ spot_price }}'
- name: image_id
value: '{{ image_id }}'
- name: instance_type
value: '{{ instance_type }}'
- name: ram_disk_id
value: '{{ ram_disk_id }}'
- name: instance_monitoring
value: '{{ instance_monitoring }}'
DELETE example
/*+ delete */
DELETE FROM awscc.autoscaling.launch_configurations
WHERE
Identifier = '{{ launch_configuration_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the launch_configurations resource, the following permissions are required:
- Read
- Create
- List
- Delete
autoscaling:DescribeLaunchConfigurations
autoscaling:CreateLaunchConfiguration,
autoscaling:DescribeLaunchConfigurations,
iam:PassRole
autoscaling:DescribeLaunchConfigurations
autoscaling:DeleteLaunchConfiguration,
autoscaling:DescribeLaunchConfigurations