Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nivleshc/7f8a3dfdd3b642aaad4d314b39480052 to your computer and use it in GitHub Desktop.
Save nivleshc/7f8a3dfdd3b642aaad4d314b39480052 to your computer and use it in GitHub Desktop.
This is the rest of the CloudFormation template for deploying Active Directory Domain Services
Properties:
DisableApiTermination: 'false'
AvailabilityZone: !Sub "${AvailabilityZone}"
InstanceInitiatedShutdownBehavior: stop
IamInstanceProfile: !Ref Profile
ImageId: !FindInMap [ AMIMap, !Ref OS, ImageId ]
InstanceType: !Sub "${InstanceSize}"
KeyName: !Sub "${KeyPair}"
UserData: !Base64
'Fn::Join':
- ''
- - "<powershell>\n"
- "cfn-init.exe "
- " --stack "
- "Ref": "AWS::StackId"
- " --resource Instance"
- " --region "
- "Ref": "AWS::Region"
- " --configsets config"
- " -v \n"
- "cfn-signal.exe "
- " ---exit-code 0"
- " --region "
- "Ref": "AWS::Region"
- " --resource Instance"
- " --stack "
- "Ref": "AWS::StackName"
- "\n"
- "</powershell>\n"
Tags:
- Key: Environment
Value: !Sub "${Environment}"
- Key: Application
Value: !Sub "${Application}"
- Key: Name
Value: !Sub "${Hostname}"
- Key: Owner
Value: !Sub "${Owner}"
- Key: OS
Value: !Sub "${OS}"
- Key: Project
Value: !Sub "${Project}"
NetworkInterfaces:
- DeleteOnTermination: 'true'
Description: Primary network interface
DeviceIndex: 0
SubnetId: !FindInMap [SubnetMap, !Ref AvailabilityZone, !Ref Environment]
GroupSet:
- sg-b15634f9
Outputs:
InstanceId:
Description: 'InstanceId'
Value: !Ref Instance
Export:
Name: !Sub '${Hostname}-${Environment}-InstanceId'
InstancePrivateIP:
Description: 'InstancePrivateIP'
Value: !GetAtt Instance.PrivateIp
Export:
Name: !Sub '${Hostname}-${Environment}-InstancePrivateIP'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment