cfn/airflow-ec2-1.10.12-Aurora-Serverless.yaml [5:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameters:
  AirflowUser:
    NoEcho: "false"
    Description: Airflow UI admin account username
    Type: String
    MinLength: "4"
    MaxLength: "41"
    AllowedPattern: "[a-zA-Z0-9]*"
    ConstraintDescription: Must contain only alphanumeric characters
  AirflowPassword:
    NoEcho: "false"
    Description: Airflow UI admin account password
    Type: String
    MinLength: "8"
    MaxLength: "41"
    AllowedPattern: "[a-zA-Z0-9]*"
    ConstraintDescription: Must contain only alphanumeric characters
  DBPassword:
    NoEcho: "false"
    Description: Airflow database admin account password
    Type: String
    MinLength: "8"
    MaxLength: "41"
    AllowedPattern: "[a-zA-Z0-9]*"
    ConstraintDescription: Must contain only alphanumeric characters

# Mapping to find the Amazon Linux AMI in each region.
Mappings:
  RegionMap:
    ap-northeast-1:
      AMI: "ami-09ebacdc178ae23b7"
    ap-northeast-2:
      AMI: "ami-0a0de518b1fc4524c"
    ap-northeast-3:
      AMI: "ami-0e787554e61105680"
    ap-south-1:
      AMI: "ami-04db49c0fb2215364"
    ap-southeast-1:
      AMI: "ami-0f511ead81ccde020"
    ap-southeast-2:
      AMI: "ami-0aab712d6363da7f9"
    ca-central-1:
      AMI: "ami-02f84cf47c23f1769"
    eu-central-1:
      AMI: "ami-0453cb7b5f2b7fca2"
    eu-west-1:
      AMI: "ami-02b4e72b17337d6c1"
    eu-west-2:
      AMI: "ami-0d26eb3972b7f8c96"
    eu-west-3:
      AMI: "ami-0d49cec198762b78c"
    sa-east-1:
      AMI: "ami-0f8243a5175208e08"
    us-east-1:
      AMI: "ami-0c2b8ca1dad447f8a"
    us-east-2:
      AMI: "ami-0443305dabd4be2bc"
    us-west-1:
      AMI: "ami-04b6c97b14c54de18"
    us-west-2:
      AMI: "ami-083ac7c7ecf9bb9b0"

Resources:
  EC2Instance:
    Type: AWS::EC2::Instance
    CreationPolicy:
      ResourceSignal:
        Timeout: PT10M
    Properties:
      SecurityGroups: [!Ref "AirflowEC2SecurityGroup"]
      InstanceType: "m4.xlarge"
      IamInstanceProfile:
        Ref: EC2InstanceProfile
      Tags:
        - Key: Name
          Value: Airflow
      ImageId: !FindInMap
        - RegionMap
        - !Ref "AWS::Region"
        - AMI
      UserData:
        Fn::Base64: !Sub |
          #!/bin/bash
          set -x
          exec > >(tee /var/log/user-data.log|logger -t user-data ) 2>&1
          ln -s /root/user-data.log /var/log/user-data.log
          # Get right version of pip
          yum install aws-cfn-bootstrap -y
          python3 -m pip install pip==20.2.4 --user
          # Start cfn-init
          /opt/aws/bin/cfn-init -v -c install --stack ${AWS::StackId} --resource EC2Instance --region ${AWS::Region}
          yum remove python3-docutils -y
          echo "Installing s3fs"
          python3 -m pip install --upgrade s3fs==0.4.2
          python3 -m pip install psycopg2 wheel
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



cfn/airflow-ec2-2.0.2-RDS.yaml [5:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameters:
  AirflowUser:
    NoEcho: "false"
    Description: Airflow UI admin account username
    Type: String
    MinLength: "4"
    MaxLength: "41"
    AllowedPattern: "[a-zA-Z0-9]*"
    ConstraintDescription: Must contain only alphanumeric characters
  AirflowPassword:
    NoEcho: "false"
    Description: Airflow UI admin account password
    Type: String
    MinLength: "8"
    MaxLength: "41"
    AllowedPattern: "[a-zA-Z0-9]*"
    ConstraintDescription: Must contain only alphanumeric characters
  DBPassword:
    NoEcho: "false"
    Description: Airflow database admin account password
    Type: String
    MinLength: "8"
    MaxLength: "41"
    AllowedPattern: "[a-zA-Z0-9]*"
    ConstraintDescription: Must contain only alphanumeric characters

# Mapping to find the Amazon Linux AMI in each region.
Mappings:
  RegionMap:
    ap-northeast-1:
      AMI: "ami-09ebacdc178ae23b7"
    ap-northeast-2:
      AMI: "ami-0a0de518b1fc4524c"
    ap-northeast-3:
      AMI: "ami-0e787554e61105680"
    ap-south-1:
      AMI: "ami-04db49c0fb2215364"
    ap-southeast-1:
      AMI: "ami-0f511ead81ccde020"
    ap-southeast-2:
      AMI: "ami-0aab712d6363da7f9"
    ca-central-1:
      AMI: "ami-02f84cf47c23f1769"
    eu-central-1:
      AMI: "ami-0453cb7b5f2b7fca2"
    eu-west-1:
      AMI: "ami-02b4e72b17337d6c1"
    eu-west-2:
      AMI: "ami-0d26eb3972b7f8c96"
    eu-west-3:
      AMI: "ami-0d49cec198762b78c"
    sa-east-1:
      AMI: "ami-0f8243a5175208e08"
    us-east-1:
      AMI: "ami-0c2b8ca1dad447f8a"
    us-east-2:
      AMI: "ami-0443305dabd4be2bc"
    us-west-1:
      AMI: "ami-04b6c97b14c54de18"
    us-west-2:
      AMI: "ami-083ac7c7ecf9bb9b0"

Resources:
  EC2Instance:
    Type: AWS::EC2::Instance
    CreationPolicy:
      ResourceSignal:
        Timeout: PT10M
    Properties:
      SecurityGroups: [!Ref "AirflowEC2SecurityGroup"]
      InstanceType: "m4.xlarge"
      IamInstanceProfile:
        Ref: EC2InstanceProfile
      Tags:
        - Key: Name
          Value: Airflow
      ImageId: !FindInMap
        - RegionMap
        - !Ref "AWS::Region"
        - AMI
      UserData:
        Fn::Base64: !Sub |
          #!/bin/bash
          set -x
          exec > >(tee /var/log/user-data.log|logger -t user-data ) 2>&1
          ln -s /root/user-data.log /var/log/user-data.log
          # Get right version of pip
          yum install aws-cfn-bootstrap -y
          python3 -m pip install pip==20.2.4 --user
          # Start cfn-init
          /opt/aws/bin/cfn-init -v -c install --stack ${AWS::StackId} --resource EC2Instance --region ${AWS::Region}
          yum remove python3-docutils -y
          echo "Installing s3fs"
          python3 -m pip install --upgrade s3fs==0.4.2
          python3 -m pip install psycopg2 wheel
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



