AWS CLI command isn't YAML valid


#1

Hey everyone

So this is my command i’m trying to run

aws ec2 authorize-security-group-ingress --region <YOUR_REGION> --group-id 
<YOUR_SECURITY_GROUP_ID> --ip-permissions "[{\"IpProtocol\": \"tcp\", \"FromPort\": 
<YOUR_PORT_YOU_NEED_OPEN>, \"ToPort\": <YOUR_PORT_YOU_NEED_OPEN>, \"IpRanges\": [ 
{\"CidrIp\": \"${public_ip_address}/32\"}]}]"

and here’s the error i’m getting :

Configuration errors: 2 errors occurred:

  • Error parsing config file: yaml: line 24: mapping values are not allowed in this context
  • Cannot find a job named build to run in the jobs: section of your configuration file.
    If you expected a workflow to run, check your config contains a top-level key called ‘workflows:’

After some investigation i’ve found that the --ip-permission argument is causing some troubles, the only thing is there’s no other way to add ip-permission via CLI ( it’s not possible to specify each arguments indepently, it has to be this kind of data structure, according to amazon doc )

is there any way to make this command YAML compliant ?


#2

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.