Differences between revisions 2 and 3
Revision 2 as of 2012-11-15 12:24:34
Size: 4015
Comment:
Revision 3 as of 2012-11-15 14:42:33
Size: 4637
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
These images where generated with the following script:
{{{
#!/bin/sh
apt-get update; apt-get install -y git; cd ~root; git clone https://github.com/andsens/ec2debian-build-ami.git; cd ~root/ec2debian-build-ami; export EC2_URL=https://ec2.us-east-1.amazonaws.com/; export EC2_ACCESS_KEY='''XXXX'''; export EC2_SECRET_KEY='''XXXX'''; ./ec2debian-build-ami --volume-size 8 --filesystem ext4 --plugin plugins/admin-user --description 'Debian 6.0.6 (Squeeze)'; ./ec2debian-build-ami --volume-size 8 --filesystem ext4 --plugin plugins/admin-user --description 'Debian 6.0.6 (Squeeze)' --arch i386; shutdown -h now
}}}
Line 16: Line 21:
These images were replicated to all regions and became identifyable by the following list of AMI IDs: These images were replicated to all AWS Regions and became identifiable by the following list of AMI IDs:

Squeeze on AWS

List of point release images published to the AWS ?Marketplace:

6.0.6

This image was created on 15/Nov/2012 by James Bromberger using the ec2debian-build-ami from https://github.com/andsens/ec2debian-build-ami by Anders Ingemann. The original images wer egenerated in account 379101102735, and the images were identifiable in the AWS US-East-1 Region as:

  • ami-7a29ad13: 379101102735/debian-squeeze-i386-20121115
  • ami-202aae49: 379101102735/debian-squeeze-amd64-20121115

These images where generated with the following script:

apt-get update; apt-get install -y git; cd ~root; git clone https://github.com/andsens/ec2debian-build-ami.git; cd ~root/ec2debian-build-ami; export EC2_URL=https://ec2.us-east-1.amazonaws.com/; export EC2_ACCESS_KEY='''XXXX'''; export EC2_SECRET_KEY='''XXXX'''; ./ec2debian-build-ami --volume-size 8 --filesystem ext4 --plugin plugins/admin-user --description 'Debian 6.0.6 (Squeeze)'; ./ec2debian-build-ami --volume-size 8 --filesystem ext4 --plugin plugins/admin-user --description 'Debian 6.0.6 (Squeeze)' --arch i386; shutdown -h now

These images were replicated to all AWS Regions and became identifiable by the following list of AMI IDs:

Region

32-bit

64-bit

US-East-1

US-West-1

US-West-2

US-Gov-West-1

EU-West-1

AP-Northeast-1

AP-Southeast-1

AP-Southeast-2

SA-East-1

The image performs the following tasks:

  • UserData that is a shell script is executed (you may wish to apply pending updates and install other software, etc)

  • The root ext4 filesystem is resized on boot (you can grow larger than the default on instance launch)
  • The root account is disabled; please SSH to the instance as the user 'admin'.

The image by default makes no contact to any external servers (no updates applied, no outbound requests, no data leakage).

CloudFormation Template

CloudFormation is a templating system for defining AWS resources - see http://aws.amazon.com/cloudformation/

{
        "Parameters" : {
                "KeyName" : {
                        "Description" : "SSH Key Name",
                        "Type" : "String",
                        "Default" : "James-Amazon-Laptop"
                },
                "MyInstanceSize": {
                        "Description": "Instance size",
                        "Type": "String",
                        "Default" : "t1.micro"
                },
                "MyInstanceName": {
                        "Description": "Instance name",
                        "Type": "String"
                }
        },
        "Mappings" : {
            "Debian606" : { 
                "us-east-1" :      { "32" : "", "64" : ""},
                "us-west-1" :      { "32" : "", "64" : ""},
                "us-west-2" :      { "32" : "", "64" : ""},
                "us-gov-west-1" :  { "32" : "", "64" : ""},
                "eu-west-1" :      { "32" : "", "64" : ""},
                "ap-southeast-1" : { "32" : "", "64" : ""},
                "ap-southeast-2" : { "32" : "", "64" : ""},
                "ap-northeast-1" : { "32" : "", "64" : ""},
                "sa-east-1" :      { "32" : "", "64" : ""},
            },
            "release" : {
                "stable" : { "squeeze" : "Debian606" }
            }
        },
        "Resources" : {
                "MyInstance" : {
                        "Type" : "AWS::EC2::Instance",
                        "Properties" : {
                                "SecurityGroups" : [ { "Ref" : "MySecurityGroup" } ],
                                "KeyName" : { "Ref": "KeyName" },
                                "Tags" : [{"Key": "Name", "Value": {"Ref" : "MyInstanceName"} } ],
                                "ImageId" : { "Fn::FindInMap" : [ "Debian606",  { "Ref" : "AWS::Region" }, "64"  ]},
                                "InstanceType" : { "Ref" : "MyInstanceSize" },
                                "UserData" : { "Fn::Base64" : "" }
                        }
                },
                "MySecurityGroup" : {
                        "Type" : "AWS::EC2::SecurityGroup",
                        "Properties" : {
                                "GroupDescription" : "Permit inbound SSH",
                                "SecurityGroupIngress" : [ 
                                    {
                                        "IpProtocol" : "tcp",
                                        "FromPort" : "22",
                                        "ToPort" : "22",
                                        "CidrIp" : "0.0.0.0/0"
                                    }
                                ]
                        }
                }
        }
}

Suggested UserData scripts

The image by default takes no actions upon boot, and does not auto-update. However, as the Debian image does honour executing UserData meta-data that looks like a script (started with #!/bin/sh), you may optionally chose to take some action. This action can be passed as a script in the AWS Console UserData input, or in the above CloudFormation template to an instance (see the UserData section in the example above).

You can chose to enable auto update with the following UserData scripts:

apt-get update && apt-get upgrade -y && apt-get install -y unattended-upgrades