title: How to create files on EC2 init
body: <p>I want to create a file with some code in it on a EC2 Instance creation.
  I use AWS Cloudformation to do so in yaml format.</p>
  
  <p>Do you see something? I can't find my mistake...</p>
  
  <pre><code>
  Resources:
    TEST: ## Creation of a WordpressUser that will be used by WebServers
      Type: AWS::EC2::Instance
      Metadata:
        AWS::CloudFormation::Init:
          config:
            files:
              /home/setup:
                content: "coucou"
                mode : "000644"
                owner: root
                group: root
      Properties:
        AvailabilityZone:
          Fn::Select:
            - 0
            - Fn::GetAZs: !Ref AWS::Region
        ImageId: ami-0bff0560e5fbc705c
        InstanceType: t2.micro
        SecurityGroupIds:
          - sg-0afaa61c82d3fe182
        SubnetId: subnet-0fe15919cc08eb4e8
        Tags:
          - Key: name
            Value: Initiate RDS
  </code></pre>