Failed to start CloudWatch agent on ubuntu server

1
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m onPremise -s -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json

/opt/aws/amazon-cloudwatch-agent/bin/config-downloader --output-dir /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d --download-source file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json --mode onPrem --config /opt/aws/amazon-cloudwatch-agent/etc/common-config.toml --multi-config default
Got Home directory: /root
I! Set home dir Linux: /root
I! SDKRegionWithCredsMap region:
Unable to determine aws-region.
Please make sure the credentials and region set correctly on your hosts.
Refer to http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
Fail to fetch the config!

/root/.aws/credentials

[default]
aws_access_key_id = *****************
aws_secret_access_key = ************************

/root/.aws/config

[default]
region = us-gov-west-1

sudo aws configure list

      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************  shared-credentials-file
secret_key     ****************  shared-credentials-file
    region            us-gov-west-1      config-file    ~/.aws/config

export AWS_REGION=us-gov-west-1

How can I solve this problem?

DD-Boom
asked 6 months ago381 views
1 Answer
0

I solved the problem by running "sudo aws configure --profile AmazonCloudWatchAgent", but a new problem appeared, the "amazon-cloudwatch-agent.json" parameter was wrong

DD-Boom
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions