Skip to main content

servers

Creates, updates, deletes or gets a server resource or lists servers in a region

Overview

Nameservers
TypeResource
DescriptionResource Type definition for AWS::OpsWorksCM::Server
Idaws.opsworkscm.servers

Fields

NameDatatypeDescription
key_pairstring
engine_versionstring
service_role_arnstring
disable_automated_backupboolean
backup_idstring
engine_modelstring
preferred_maintenance_windowstring
associate_public_ip_addressboolean
instance_profile_arnstring
custom_certificatestring
preferred_backup_windowstring
security_group_idsarray
subnet_idsarray
custom_domainstring
endpointstring
custom_private_keystring
server_namestring
engine_attributesarray
backup_retention_countinteger
arnstring
instance_typestring
tagsarray
enginestring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTServiceRoleArn, InstanceProfileArn, InstanceType, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.opsworkscm.servers (
ServiceRoleArn,
InstanceProfileArn,
InstanceType,
region
)
SELECT
'{{ ServiceRoleArn }}',
'{{ InstanceProfileArn }}',
'{{ InstanceType }}',
'{{ region }}';

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