simple_ads
Creates, updates, deletes or gets a simple_ad resource or lists simple_ads in a region
Overview
| Name | simple_ads |
| Type | Resource |
| Description | Resource Type definition for AWS::DirectoryService::SimpleAD |
| Id | awscc.directoryservice.simple_ads |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
directory_id | string | The unique identifier for a directory. |
alias | string | The alias for a directory. |
dns_ip_addresses | array | The IP addresses of the DNS servers for the directory, such as [ "172.31.3.154", "172.31.63.203" ]. |
create_alias | boolean | The name of the configuration set. |
description | string | Description for the directory. |
enable_sso | boolean | Whether to enable single sign-on for a Simple Active Directory in AWS. |
name | string | The fully qualified domain name for the AWS Managed Simple AD directory. |
password | string | The password for the default administrative user named Admin. |
short_name | string | The NetBIOS name for your domain. |
size | string | The size of the directory. |
vpc_settings | object | VPC settings of the Simple AD directory server in AWS. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
directory_id | string | The unique identifier for a directory. |
region | string | AWS region. |
For more information, see AWS::DirectoryService::SimpleAD.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | simple_ads | INSERT | VpcSettings, Size, Name, region |
delete_resource | simple_ads | DELETE | Identifier, region |
update_resource | simple_ads | UPDATE | Identifier, PatchDocument, region |
list_resources | simple_ads_list_only | SELECT | region |
get_resource | simple_ads | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual simple_ad.
SELECT
region,
directory_id,
alias,
dns_ip_addresses,
create_alias,
description,
enable_sso,
name,
password,
short_name,
size,
vpc_settings
FROM awscc.directoryservice.simple_ads
WHERE
region = '{{ region }}' AND
Identifier = '{{ directory_id }}';
Lists all simple_ads in a region.
SELECT
region,
directory_id
FROM awscc.directoryservice.simple_ads_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new simple_ad resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.directoryservice.simple_ads (
Name,
Size,
VpcSettings,
region
)
SELECT
'{{ name }}',
'{{ size }}',
'{{ vpc_settings }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.directoryservice.simple_ads (
CreateAlias,
Description,
EnableSso,
Name,
Password,
ShortName,
Size,
VpcSettings,
region
)
SELECT
'{{ create_alias }}',
'{{ description }}',
'{{ enable_sso }}',
'{{ name }}',
'{{ password }}',
'{{ short_name }}',
'{{ size }}',
'{{ vpc_settings }}',
'{{ 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: simple_ad
props:
- name: create_alias
value: '{{ create_alias }}'
- name: description
value: '{{ description }}'
- name: enable_sso
value: '{{ enable_sso }}'
- name: name
value: '{{ name }}'
- name: password
value: '{{ password }}'
- name: short_name
value: '{{ short_name }}'
- name: size
value: '{{ size }}'
- name: vpc_settings
value:
subnet_ids:
- '{{ subnet_ids[0] }}'
vpc_id: '{{ vpc_id }}'
UPDATE example
Use the following StackQL query and manifest file to update a simple_ad resource, using stack-deploy.
/*+ update */
UPDATE awscc.directoryservice.simple_ads
SET PatchDocument = string('{{ {
"EnableSso": enable_sso
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ directory_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.directoryservice.simple_ads
WHERE
Identifier = '{{ directory_id }}' 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 simple_ads resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ds:CreateDirectory,
ds:CreateAlias,
ds:EnableSso,
ds:DescribeDirectories,
ec2:DescribeSubnets,
ec2:DescribeVpcs,
ec2:CreateSecurityGroup,
ec2:CreateNetworkInterface,
ec2:DescribeNetworkInterfaces,
ec2:AuthorizeSecurityGroupIngress,
ec2:AuthorizeSecurityGroupEgress,
ec2:CreateTags,
ec2:RevokeSecurityGroupIngress,
ec2:RevokeSecurityGroupEgress
ds:DescribeDirectories
ds:EnableSso,
ds:DisableSso,
ds:DescribeDirectories
ds:DeleteDirectory,
ds:DescribeDirectories,
ec2:DescribeNetworkInterfaces,
ec2:DeleteSecurityGroup,
ec2:DeleteNetworkInterface,
ec2:RevokeSecurityGroupIngress,
ec2:RevokeSecurityGroupEgress,
ec2:DeleteTags
ds:DescribeDirectories