servers
Creates, updates, deletes or gets a server
resource or lists servers
in a region
Overview
Name | servers |
Type | Resource |
Description | Resource Type definition for AWS::OpsWorksCM::Server |
Id | aws.opsworkscm.servers |
Fields
Name | Datatype | Description |
---|---|---|
key_pair | string | |
engine_version | string | |
service_role_arn | string | |
disable_automated_backup | boolean | |
backup_id | string | |
engine_model | string | |
preferred_maintenance_window | string | |
associate_public_ip_address | boolean | |
instance_profile_arn | string | |
custom_certificate | string | |
preferred_backup_window | string | |
security_group_ids | array | |
subnet_ids | array | |
custom_domain | string | |
endpoint | string | |
custom_private_key | string | |
server_name | string | |
engine_attributes | array | |
backup_retention_count | integer | |
arn | string | |
instance_type | string | |
tags | array | |
engine | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | ServiceRoleArn, InstanceProfileArn, InstanceType, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all servers
in a region.
SELECT
region,
key_pair,
engine_version,
service_role_arn,
disable_automated_backup,
backup_id,
engine_model,
preferred_maintenance_window,
associate_public_ip_address,
instance_profile_arn,
custom_certificate,
preferred_backup_window,
security_group_ids,
subnet_ids,
custom_domain,
endpoint,
custom_private_key,
server_name,
engine_attributes,
backup_retention_count,
arn,
instance_type,
tags,
engine
FROM aws.opsworkscm.servers
WHERE region = 'us-east-1';
Gets all properties from an individual server
.
SELECT
region,
key_pair,
engine_version,
service_role_arn,
disable_automated_backup,
backup_id,
engine_model,
preferred_maintenance_window,
associate_public_ip_address,
instance_profile_arn,
custom_certificate,
preferred_backup_window,
security_group_ids,
subnet_ids,
custom_domain,
endpoint,
custom_private_key,
server_name,
engine_attributes,
backup_retention_count,
arn,
instance_type,
tags,
engine
FROM aws.opsworkscm.servers
WHERE region = 'us-east-1' AND data__Identifier = '<ServerName>';
INSERT
example
Use the following StackQL query and manifest file to create a new server
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.opsworkscm.servers (
ServiceRoleArn,
InstanceProfileArn,
InstanceType,
region
)
SELECT
'{{ ServiceRoleArn }}',
'{{ InstanceProfileArn }}',
'{{ InstanceType }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.opsworkscm.servers (
KeyPair,
EngineVersion,
ServiceRoleArn,
DisableAutomatedBackup,
BackupId,
EngineModel,
PreferredMaintenanceWindow,
AssociatePublicIpAddress,
InstanceProfileArn,
CustomCertificate,
PreferredBackupWindow,
SecurityGroupIds,
SubnetIds,
CustomDomain,
CustomPrivateKey,
EngineAttributes,
BackupRetentionCount,
InstanceType,
Tags,
Engine,
region
)
SELECT
'{{ KeyPair }}',
'{{ EngineVersion }}',
'{{ ServiceRoleArn }}',
'{{ DisableAutomatedBackup }}',
'{{ BackupId }}',
'{{ EngineModel }}',
'{{ PreferredMaintenanceWindow }}',
'{{ AssociatePublicIpAddress }}',
'{{ InstanceProfileArn }}',
'{{ CustomCertificate }}',
'{{ PreferredBackupWindow }}',
'{{ SecurityGroupIds }}',
'{{ SubnetIds }}',
'{{ CustomDomain }}',
'{{ CustomPrivateKey }}',
'{{ EngineAttributes }}',
'{{ BackupRetentionCount }}',
'{{ InstanceType }}',
'{{ Tags }}',
'{{ Engine }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: server
props:
- name: KeyPair
value: '{{ KeyPair }}'
- name: EngineVersion
value: '{{ EngineVersion }}'
- name: ServiceRoleArn
value: '{{ ServiceRoleArn }}'
- name: DisableAutomatedBackup
value: '{{ DisableAutomatedBackup }}'
- name: BackupId
value: '{{ BackupId }}'
- name: EngineModel
value: '{{ EngineModel }}'
- name: PreferredMaintenanceWindow
value: '{{ PreferredMaintenanceWindow }}'
- name: AssociatePublicIpAddress
value: '{{ AssociatePublicIpAddress }}'
- name: InstanceProfileArn
value: '{{ InstanceProfileArn }}'
- name: CustomCertificate
value: '{{ CustomCertificate }}'
- name: PreferredBackupWindow
value: '{{ PreferredBackupWindow }}'
- name: SecurityGroupIds
value:
- '{{ SecurityGroupIds[0] }}'
- name: SubnetIds
value:
- '{{ SubnetIds[0] }}'
- name: CustomDomain
value: '{{ CustomDomain }}'
- name: CustomPrivateKey
value: '{{ CustomPrivateKey }}'
- name: EngineAttributes
value:
- Value: '{{ Value }}'
Name: '{{ Name }}'
- name: BackupRetentionCount
value: '{{ BackupRetentionCount }}'
- name: InstanceType
value: '{{ InstanceType }}'
- name: Tags
value:
- Value: '{{ Value }}'
Key: '{{ Key }}'
- name: Engine
value: '{{ Engine }}'
DELETE
example
/*+ delete */
DELETE FROM aws.opsworkscm.servers
WHERE data__Identifier = '<ServerName>'
AND region = 'us-east-1';
Permissions
To operate on the servers
resource, the following permissions are required:
Create
opsworks-cm:CreateServer,
opsworks-cm:DescribeServers,
iam:PassRole
Delete
opsworks-cm:DeleteServer,
opsworks-cm:DescribeServers
Update
opsworks-cm:UpdateServer,
opsworks-cm:TagResource,
opsworks-cm:UntagResource,
opsworks-cm:DescribeServers
List
opsworks-cm:DescribeServers,
opsworks-cm:ListTagsForResource
Read
opsworks-cm:DescribeServers