I'm able to run this on my terminal (Macbook)
$ aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-
east-1:123456789012:listener/app/sb-zift-admin-lb/123456789012/abcdefghij12
--default-actions Type=redirect,RedirectConfig=
"{Protocol=HTTPS,Port=443,Host='#{host}',Query='#{query}',Path='/#{path}',StatusCode=HTTP_301}"
or
$ aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-
east-1:123456789012:listener/app/sb-zift-admin-lb/123456789012/abcdefghij12
--default-actions '[{"Type": "redirect", "RedirectConfig": {"Protocol":
"HTTPS", "Port": "443", "Host": "#{host}", "Query": "#{query}", "Path":
"/#{path}", "StatusCode": "HTTP_301"}}]'
But when I script this into Jenkins pipeline, it doesn't work for me. Like
this...
def httpListenerArn = arn:myAWSlistener
def defaultActions =
'[{\\"Type\\":\\"redirect\\",\\"RedirectConfig\\":{\\"Protocol\\":\\"HTTPS\\",\\"Port\\":\\"443\\",\\"Host\\":\\"#{host}\\",\\"Query\\":\\"#{query}\\",\\"Path\\":\\"/#{path}\\",\\"StatusCode\\":\\"HTTP_301\\"}}]'
sh = """
aws elbv2 modify-listener --listener-arn $httpListenerArn
--default-actions \\'$defaultActions\\'
"""
I get this output on the console
+ aws elbv2 modify-listener --listener-arn arm:mySWSListener --default-actions
'[{"Type":"redirect","RedirectConfig":{"Protocol":"HTTPS","Port":"443","Host":"#{host}","Query":"#{query}","Path":"/#{path}","StatusCode":"HTTP_301"}}]'
Error parsing parameter '--default-actions': Expected: '=', received: ''' for
input:
'[{"Type":"redirect","RedirectConfig":{"Protocol":"HTTPS","Port":"443","Host":"#{host}","Query":"#{query}","Path":"/#{path}","StatusCode":"HTTP_301"}}]'
^
If I cut/paste what Jenkins spits out (command after + in output console) onto
my terminal, it works. Any clues?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/0eba2ba3-4f84-490a-9cca-d559f8d80574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.