Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am quanghiem on github.
  • I am quanghiem (https://keybase.io/quanghiem) on keybase.
  • I have a public key ASDxvbhGa_DtE0om6nxKDEdz7GcJ0VEUgkckDcUQEnPbOQo

To claim this, I am signing this object:

data "aws_instance" "xxx" {
filter {
name = "tag:Name"
values = ["xxx"]
}
}
resource "aws_security_group" "xxx" {
name = "xxx"
vpc_id = "${var.vpc_id}"
# Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM
# AND install 7-zip, curl and .NET 4 if its missing.
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2008 SP2 64bits AMIs provided by Amazon
#
# Inject this as user-data of a Windows 2008 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted
@quanghiem
quanghiem / gist:3c3aef05a4a303c81450
Last active February 4, 2016 16:56
DSC NewPullServer
# http://www.systemcentercentral.com/day-1-intro-to-powershell-dsc-and-configuring-your-first-pull-server/
configuration NewPullServer
{
param
(
[string[]]$ComputerName = ‘localhost’
)
Import-DSCResource -ModuleName xPSDesiredStateConfiguration