我试图在环境中传递JSON字符串.
- name: Start {{service_name}}
shell: "<<starting springboot jar>> --server.port={{service_port}}\""
environment:
- SPRING_APPLICATION_JSON: '{"test-host.1":"{{test_host_1}}","test-host.2":"{{test_host_2}}"}'
Run Code Online (Sandbox Code Playgroud)
test_host_1是172.31.00.00
test_host_2是172.31.00.00
但是在spring日志中,我会在打印时获得JSON解析异常
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character (''' (code 39)): was expecting double-quote to start field name
at [Source: {'test-host.1': '172.31.00.00', 'test-host.2': '172.31.00.00'}; line: 1, column: 3]
Run Code Online (Sandbox Code Playgroud)
如图所示,双引号转换为单引号!
我试图逃避双引号但没有运气.
知道为什么会这样,或者任何解决方法吗?
我的问题是的扩展版本此.
在我的情况下,安全组必须限制对Load Balancer 1的访问.它必须有一些列入白名单的IP.那么,我可以在这里放哪些IP,允许从Auto Scaling Group 2私有实例访问Load Balancer 1?
我已经尝试将NAT网关的弹性IP作为列入白名单的IP并且它可以工作.我想了解为什么绝对有必要将此IP放入安全组以从同一VPC的私有子网实例访问面向Internet的ALB .
nat amazon-web-services aws-security-group elastic-load-balancer