scripts/cfn-template.yaml [115:150]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        sudo yum install maven -y
        sudo yum install amazon-cloudwatch-agent -y
        cat <<EOF >/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json
        {
          "metrics": {
            "metrics_collected": {
              "mem": {
                "measurement": [
                  "mem_used_percent"
                ],
                "metrics_collection_interval":30
              },
              "swap": {
                "measurement": [
                  "swap_used_percent"
                ],
                "metrics_collection_interval":30
              }
            }
          }
        }
        EOF
        sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
          -a fetch-config \
          -m ec2 \
          -s \
          -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json
      # Adding instance profile
      IamInstanceProfile: !Ref "InstanceProfile"
      SecurityGroups:
        - !Ref "InstanceSecurityGroupSsh"
        - !Ref "InstanceSecurityGroupHttp"
      KeyName: !Ref "KeyName"
      ImageId: !Ref "LatestAmiIdArm64"
      # PlacementGroupName: !Ref "PlacementGroup"
      AvailabilityZone: !Ref "AzName"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



scripts/cfn-template.yaml [165:200]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        sudo yum install maven -y
        sudo yum install amazon-cloudwatch-agent -y
        cat <<EOF >/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json
        {
          "metrics": {
            "metrics_collected": {
              "mem": {
                "measurement": [
                  "mem_used_percent"
                ],
                "metrics_collection_interval":30
              },
              "swap": {
                "measurement": [
                  "swap_used_percent"
                ],
                "metrics_collection_interval":30
              }
            }
          }
        }
        EOF
        sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
          -a fetch-config \
          -m ec2 \
          -s \
          -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json
      # Adding instance profile
      IamInstanceProfile: !Ref "InstanceProfile"
      SecurityGroups:
        - !Ref "InstanceSecurityGroupSsh"
        - !Ref "InstanceSecurityGroupHttp"
      KeyName: !Ref "KeyName"
      ImageId: !Ref "LatestAmiIdArm64"
      # PlacementGroupName: !Ref "PlacementGroup"
      AvailabilityZone: !Ref "AzName"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



