New answers tagged

0

An upgrade of aws-cli fixed the issue. Below commands, I ran and got the issue resolved. zypper in python-pip pip install --upgrade awscli aws --version aws-cli/1.17.17 Python/2.7.13 Linux/4.12.14-95.6-default botocore/1.14.17


1

Well, doing aws kms encrypt help gave me the solution: $ aws kms encrypt --region us-east-1 --key-id vvvvvvvv --output text --query CiphertextBlob --plaintext fileb://clientsecret.txt Where clientsecret.txt holds the string surrounded by dashes.


1

In the above example "local" means the VPC router will send traffic in that cidr range to the local VPC. Specifically, it will send the traffic to the specific network interface that has the IP address specified and drop the packet if nothing in your VPC has that IP address. Also worth noting, is the local rule can't be overridden. The VPC router will ...


2

If you're using the AWS CLI, as a user you can do (on the instance itself): aws ec2 reboot-instances --instance-ids $(curl -s http://instance-data/latest/meta-data/instance-id) See this discussion on getting the EC2 ID from within the instance itself. If you want to test to see if you have the required permissions before running, try including the --dry-...


0

You can ignore it with aws s3 ls documents/files | head -n -1, which will return all but the last line of the results. From the head man page: head [OPTION]... [FILE]... With no FILE, or when FILE is -, read standard input. -n, --lines=[-]K print the first K lines instead of the first 10; with the leading '-', print all but the last K lines ...


3

I think you're looking for: ubuntu ALL=/sbin/halt, /sbin/reboot This is identical to: ubuntu ALL=(ALL:ALL) /sbin/halt, /sbin/reboot Generally, you should always use visudo to edit your sudoers configuration, because it performs a syntax check on the file before placing it in the final location. See the sudoers(5) man page for complete documentation, ...


0

Using jq to parse out the value of the Value key in the top-level Parameter structure: aws ssm get-parameter --name /mysite/dev/email | jq -r '.Parameter.Value' This will additionally decode any JSON encoding of the value, so that a value that is stored in JSON as \"The Admin\" <admin@example.com> comes back as "The Admin" <admin@example.com>.


1

You haven't specified your OS, but assuming you have GNU date, you can convert the date to a timestamp and then perform a simple calculation to determine if it's older than two hours ago: datetime=$( aws s3 ls --endpoint=https://localhost s3://files/ | awk 'END {print $1, $2}' ) timestamp=$(date --date "$datetime" +'%s') timeAgo=$(date --date "2 ...


3

For a one-liner, you can just remove all commas and quotes first. awk '/Value/ { gsub(/[",]/,""); print $2}' A better translation of your awk | sed pipeline would be awk '/Value/ { gsub(/[",]/,"",$2); print $2}' to just alter the values in the second field.


Top 50 recent answers are included