Skip to content

Instantly share code, notes, and snippets.

@duffney
Last active August 12, 2019 19:22
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 duffney/3e9dae330f9f76ea65a744cfdfe43d7a to your computer and use it in GitHub Desktop.
Save duffney/3e9dae330f9f76ea65a744cfdfe43d7a to your computer and use it in GitHub Desktop.
Resources:
Ec2Instance:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-0a9ca0496f746e6e0
InstanceType: t2.micro
Tags:
- Key: Name
Value: "WinTest01"
- Key: NameOfService
Value: "Lab Win VM"
SecurityGroups:
- !Ref MySecurityGroup
KeyName: awsPSKeyPair
UserData:
'Fn::Base64':
<powershell>
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'));
</powershell>
MySecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupName: SimpleWinGroup
GroupDescription: Enable RDP traffic via port 3389
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 3389
ToPort: 3389
CidrIp: 0.0.0.0/0
Outputs:
ServerDns:
Value: !GetAtt
- Ec2Instance
- PublicDnsName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment