aws efs create-access-point command is not working? - amazon-web-services

I tried to create an access point for my efs file system using following command:
aws efs create-access-point --file-system-id fs-0163391d24d0b14b5 --posix-user Uid=1001,Gid=1001 --root-directory Path="/mnt/",CreationInfo={OwnerUid=1001,OwnerGid=1001,Permissions="0755"}
This command is not working and giving following message:
"usage: aws [options] [ ...] [parameters]
To see help text, you can run:
aws help
aws help
aws help
Unknown options: Path=/mnt/,CreationInfo=Permissions=0755, Path=/mnt/,CreationInfo=OwnerGid=1001"
Please tell me what is wrong with this command ? I am using this command after referring to aws cli guide docs only.

You have too many ". It should be:
aws efs create-access-point --file-system-id fs-0163391d24d0b14b5 --posix-user Uid=1001,Gid=1001 --root-directory Path='/mnt,CreationInfo={OwnerUid=1001,OwnerGid=1001,Permissions=0755}'

Related

Why the command aws iam list-users not working?

aws iam list-users command not working
I have setup AWS CLI in Windows. The path has been added under the system environment variable.
When I try the commands aws --version and aws configure, it is successful. But to see the list of users the command aws iam list-users is throwing this error:
'more' is not recognized as an internal or external command, operable program or batch file.
I am stuck. Could anyone help please?
It sounds like the AWS CLI is trying to use an output paginator that is not in the path.
Put simply, AWS CLI sends its output via a utility that lets you 'page' through the results. In your case, it is trying to use the more command.
You can tell the AWS CLI not to use a paginator by putting this in the .aws/config file:
[default]
cli_pager=
For more details, see: Using AWS CLI pagination options - Client-side pager - AWS Command Line Interface

Error `executable aws not found` with kubectl config defined by `aws eks update-kubeconfig`

I defined my KUBECONFIG for the AWS EKS cluster:
aws eks update-kubeconfig --region eu-west-1 --name yb-demo
but got the following error when using kubectl:
...
Use "kubectl <command> --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all commands).
[opc#C eks]$ kubectl get sc
Unable to connect to the server: getting credentials: exec: executable aws not found
It looks like you are trying to use a client-go credential plugin that is not installed.
To learn more about this feature, consult the documentation available at:
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins
You can also append your custom aws cli installation path to the $PATH variable in ~/.bash_profile: export PATH=$PATH:<path to aws cli program directory>. This way you do not need to sed the kubeconfig file every time you add an EKS cluster. Also you will be able to use aws command at the command prompt without specifying full path to the program for every execution.
I had this problem when installing kubectx on Ubuntu Linux via a Snap package. It does not seem to be able to access the AWS CLI then. I worked around the issue by removing the Snap package and just using the shell scripts instead.
It seems that in ~/.kube/config the command: aws doesn't use the PATH environment and doesn't find it. Here is how to change it to the full path:
sed -e "/command: aws/s?aws?$(which aws)?" -i ~/.kube/config

aws transfer update-server is throwing errors

I am using terraform to create an aws sftp server and trying to use IP whitelisting to secure my server.
Terraform aws_transfer_server command supports only endpoint_types such as PUBLIC or VPC_ENDPOINT at this time. So I am using null_resource to execute an aws command to update the sftp server after it was created. The terraform snippet is below:
resource "null_resource" "update_sftp_server" {
provisioner "local-exec" {
command = <<EOF
aws transfer update-server --server-id ${aws_transfer_server.sftp.id} --endpoint-type VPC --endpoint-details SubnetIds="${join("\", \"", var.subnet_ids)}", AddressAllocationIds="${join("\", \"", toset(aws_eip.nlb.*.id))}", VPCEndpointID="${aws_vpc_endpoint.transfer.id}", VpcId="${var.vpc_id}"
EOF
}
depends_on = [aws_transfer_server.sftp, aws_vpc_endpoint.transfer]
}
This executes the below aws command
aws transfer update-server --server-id s-######## --endpoint-type VPC --endpoint-details SubnetIds="subnet-#####", "subnet-#####", AddressAllocationIds="eipalloc-######", "eipalloc-######", VPCEndpointID="vpce-#######", VpcId="vpc-#####"
But I am getting an error as below:
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
Unknown options: AddressAllocationIds=eipalloc-######, eipalloc-######, VPCEndpointID=vpce-######, VpcId=vpc-######, subnet-######
Can someone help me to know why this error is thrown? My environment details are below:
Terraform v0.12.28
provider.aws v3.0.0
provider.null v2.1.2
aws-cli/2.0.33 Python/3.7.7 Windows/10 botocore/2.0.0dev37
Have you tried building your argument list without spaces? So that it looks like SubnetIds="subnet-#####","subnet-#####",AddressAllocationIds="eipalloc-######","eipalloc-######",VPCEndpointID="vpce-#######",VpcId="vpc-#####" ?
Otherwise when the commandline is broken up into tokens, most of those bits will not be parsed as part of the --endpoint-details argument.

AWS Translate | Asynchronous Batch Processing | CLI | describe-text-translation-job not valid command

I have installed and configure AWS CLI both my windows 10 machine and AWS EC2 Linux machine also have one AWS translated batch job in frankfurt aws region. I am following this document for to initiate the batch translation process using CLI. https://docs.aws.amazon.com/translate/latest/dg/translate-dg.pdf
Now, suppose I am using this sample command
aws translate describe-text-translation-job --job-id xxxxxxx
I am getting this error everyplace
[ec2-user#ip-xx-xx-xx-xx ~]$ aws translate describe-text-translation-job --job-id xxxxxxx
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
delete-terminology | get-terminology
import-terminology | list-terminologies
translate-text | help
It only show 5 valid choice other than help but as per the documentation it should be more
https://docs.aws.amazon.com/cli/latest/reference/translate/index.html#cli-aws-translate
why I am not getting these options
describe-text-translation-job
start-text-translation-job
stop-text-translation-job
list-text-translation-jobs
It was AWS CLI version problem only, I updated the version and now I get all the required methods.

NoSuchBucket error when running Kubernetes on AWS

Downloaded Kubernetes 1.1.8 from:
https://github.com/kubernetes/kubernetes/releases/download/v1.1.8/kubernetes.tar.gz
Followed the instructions at:
https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/aws.md
And got the following error:
kubernetes-1.1.8 > ./kubernetes/cluster/kube-up.sh
... Starting cluster using provider: aws
... calling verify-prereqs
... calling kube-up
Starting cluster using os distro: vivid
Uploading to Amazon S3
Creating kubernetes-staging-0eaf81fbc51209dd47c13b6d8b424149
make_bucket: s3://kubernetes-staging-0eaf81fbc51209dd47c13b6d8b424149/
A client error (NoSuchBucket) occurred when calling the GetBucketLocation operation: The specified bucket does not exist
+++ Staging server tars to S3 Storage: kubernetes-staging-0eaf81fbc51209dd47c13b6d8b424149/devel
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument --region: expected one argument
AWS Console showed that the bucket was created but was empty.
It's probably a region issue; I'm guessing that the bucket is created in another region than Kubernetes tries to access.
Looks like the aws cmdline tool is confused about the region:
aws: error: argument --region: expected one argument
When it can't determine the region, it defaults to one of the us regions.
EDIT: the S3 sync is triggered by script cluster/aws/util.sh.
The command executed is aws s3 sync --region ${s3_bucket_location} --exact-timestamps ${local_dir} "s3://${AWS_S3_BUCKET}/${staging_path}/".
You can add an echo ${s3_bucket_location} before the line above. It should give you more information on what the region is set to.