automated-actions/AWS_EBS_VOLUME_LOST/SydneySummitDemo/aws_ebs_vol_lost_importantapp-cfn.yaml [1:65]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  RestoreImageId:
    Description: Snapshot to be used as root disk - leave this blank when creating the Stack.
    Type: "String"
  KeyName:
    Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
    Type: "AWS::EC2::KeyPair::KeyName"
  InstanceType:
    Description: WebServer EC2 instance type
    Type: "String"
    Default: t2.small
    AllowedValues: [t1.micro, t2.nano, t2.micro, t2.small, t2.medium]
  VpcId:
    Type: "AWS::EC2::VPC::Id"
    Description: VpcId of your existing Virtual Private Cloud (VPC)
  SubnetId:
    Type: "AWS::EC2::Subnet::Id"
    Description: SubnetId of an existing subnet (for the primary network) in your
      Virtual Private Cloud (VPC)
      Cloud.
  SSHLocation:
    Description: The IP address range that can be used to SSH to the EC2 instances
    Type: "String"
    Default: 0.0.0.0/0
    AllowedPattern: (\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})

Conditions:
  RestoreImageIdCond: !Not [!Equals [!Ref RestoreImageId, "" ]]

Resources:
  ## Elastic IPs
  EIP0:
    Type: AWS::EC2::EIP
    Properties:
      Domain: vpc
  EIPAssoc0:
    Type: AWS::EC2::EIPAssociation
    Properties:
      InstanceId: !Ref EC2Instance
      AllocationId: !GetAtt [EIP0, AllocationId]

  # Security Groups
  SSHSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      VpcId: !Ref VpcId
      GroupDescription: Enable SSH access via port 22
      SecurityGroupIngress:
      - IpProtocol: tcp
        FromPort: 22
        ToPort: 22
        CidrIp: !Ref SSHLocation

  # Instance
  EC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId:
        !If
          - RestoreImageIdCond
          - !Ref RestoreImageId
          - !GetAtt CustomLookupAmi.ImageId
      InstanceType: !Ref InstanceType
      KeyName: !Ref KeyName
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



automated-actions/AWS_EBS_VOLUME_LOST/stepbystep/step_2_app_reinvent_workshop.yml [1:65]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  RestoreImageId:
    Description: Snapshot to be used as root disk - leave this blank when creating the Stack.
    Type: "String"
  KeyName:
    Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
    Type: "AWS::EC2::KeyPair::KeyName"
  InstanceType:
    Description: WebServer EC2 instance type
    Type: "String"
    Default: t2.small
    AllowedValues: [t1.micro, t2.nano, t2.micro, t2.small, t2.medium]
  VpcId:
    Type: "AWS::EC2::VPC::Id"
    Description: VpcId of your existing Virtual Private Cloud (VPC)
  SubnetId:
    Type: "AWS::EC2::Subnet::Id"
    Description: SubnetId of an existing subnet (for the primary network) in your
      Virtual Private Cloud (VPC)
      Cloud.
  SSHLocation:
    Description: The IP address range that can be used to SSH to the EC2 instances
    Type: "String"
    Default: 0.0.0.0/0
    AllowedPattern: (\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})

Conditions:
  RestoreImageIdCond: !Not [!Equals [!Ref RestoreImageId, "" ]]

Resources:
  ## Elastic IPs
  EIP0:
    Type: AWS::EC2::EIP
    Properties:
      Domain: vpc
  EIPAssoc0:
    Type: AWS::EC2::EIPAssociation
    Properties:
      InstanceId: !Ref EC2Instance
      AllocationId: !GetAtt [EIP0, AllocationId]

  # Security Groups
  SSHSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      VpcId: !Ref VpcId
      GroupDescription: Enable SSH access via port 22
      SecurityGroupIngress:
      - IpProtocol: tcp
        FromPort: 22
        ToPort: 22
        CidrIp: !Ref SSHLocation

  # Instance
  EC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId:
        !If
          - RestoreImageIdCond
          - !Ref RestoreImageId
          - !GetAtt CustomLookupAmi.ImageId
      InstanceType: !Ref InstanceType
      KeyName: !Ref KeyName
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



