awsdocs/aws-cloudformation-user-guide

/var/log/cfn-init.log does not exist

LuisSaybe opened this issue · 2 comments

The documentation here indicates that "You can then SSH into the console and read the logs at /var/log/cfn-init.log.", but /var/log/cfn-init.log does not exist on my EC2 instance.

On the other hand, the files /var/log/cloud-init-output.log and /var/log/cloud-init.log do exist. This seems like a typo perhaps?

Here is the resources definition for the EC2 instance I am running

Resources:
  AirbyteKeyPair:
    Type: AWS::EC2::KeyPair
    Properties:
      KeyName: AirbyteKeyPair
      PublicKeyMaterial: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILLKt3nEmiNSX90UmDDuHTU7LFwhQXn//UruHnbBQ/Rg your_email@example.com
  Airbyte:
    Type: AWS::EC2::Instance
    CreationPolicy:
      ResourceSignal:
        Timeout: PT5M
    Metadata:
      AWS::CloudFormation::Init:
        configSets:
          default:
            - install_docker
        install_docker:
          packages:
            yum:
              docker: []
          services:
            sysvinit:
              docker:
                enabled: "true"
                ensureRunning: "true"
          commands:
            modify_docker_permissions:
              command: usermod -G docker ec2-user
            create_compose_directory:
              command: mkdir -p /home/ec2-user/.docker/cli-plugins
            install_docker_compose:
              command: curl -SL https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o /home/ec2-user/.docker/cli-plugins/docker-compose
    Properties:
      ImageId: ami-06a54aa5e58a60898 #Amazon Linux 2023 AMI 64 bit arm
      InstanceType: t4g.large
      SubnetId: !Ref PublicSubnetId
      KeyName: !Ref AirbyteKeyPair
      Tags:
        - Key: Name
          Value: airbyte-production
      SecurityGroupIds:
        - !Ref SecurityGroupId
      UserData: !Base64
        "Fn::Sub":
          - >
            #!/bin/bash -x
            yum install -y aws-cfn-bootstrap
            /opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource Airbyte --region ${AWS::Region}
            /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource Airbyte --region ${AWS::Region}
          - {}
Zujiry commented

Did you check if /opt/aws/bin/cfn-init exists?

Closing this issue or pull request in advance of archiving this repo. For more information about the decision to archive this repo (and others in the 'awsdocs' org), see the announcement on the AWS News Blog.