AnimeshShaw's picture
Add human_reference_dataset/aws-cloudformation-templates/DirectoryService/
4112f82
Raw
History Blame Contribute Delete
1.99 kB
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
DomainName:
Description: FQDN of the domain for this directory
Type: String
Default: corp.example.com
SimpleADShortName:
Description: Netbios name of the domain for this directory
Type: String
Default: corp
CreateAlias:
Description: Only required for applications which need a URL to connect to the directory
Type: String
AllowedValues:
- "true"
- "false"
Default: "false"
PrivateSubnet1:
Description: Subnet to be used for the Directoty
Type: List<AWS::EC2::Subnet::Id>
PrivateSubnet2:
Description: Subnet to be used for the Directoty
Type: List<AWS::EC2::Subnet::Id>
VPCID:
Description: The VPC the directory will be created in
Type: List<AWS::EC2::VPC::Id>
Size:
Description: Size of the Simple AD
Type: String
AllowedValues:
- Small
- Large
Default: Small
Conditions:
Alias: !Equals
- !Ref CreateAlias
- "true"
Resources:
SimpleAD:
Type: AWS::DirectoryService::SimpleAD
Properties:
CreateAlias: false
EnableSso: false
Name: !Ref DomainName
Password: '{{resolve:secretsmanager:simple-ad-pw:SecretString:pasword}}'
ShortName: !Ref SimpleADShortName
Size: !Ref Size
VpcSettings:
SubnetIds:
- !Select
- "0"
- !Ref PrivateSubnet1
- !Select
- "0"
- !Ref PrivateSubnet2
VpcId: !Select
- "0"
- !Ref VPCID
Outputs:
DirectoryID:
Description: ID of the SimpleAD
Value: !Ref SimpleAD
PrimaryDNS:
Description: DNS IPs of the SimpleAD
Value: !Select
- 0
- !GetAtt SimpleAD.DnsIpAddresses
SecondaryDNS:
Description: DNS IPs of the SimpleAD
Value: !Select
- 1
- !GetAtt SimpleAD.DnsIpAddresses
DirectoryAlias:
Description: URL for the alias
Value: !GetAtt SimpleAD.Alias
Condition: Alias