내 aws Cloud Formation cfn configset에서 아파치 또는 www- 데이터 일 수있는 것처럼 사용자 그룹의 이름에 환경 키를 설정하는 명령이 있습니다. 배포판에 따라. 이 같은grep을 수집하고 aws configset에서 사용하는 방법
뭔가 :이 스택을 시작할 때
Metadata:
AWS::CloudFormation::Init:
configSets:
joomla:
- "set_permissions"
- "and_some_more..."
configure_cfn:
files:
/etc/cfn/hooks.d/cfn-auto-reloader.conf:
content: !Sub |
[cfn-auto-reloader-hook]
triggers=post.update
path=Resources.EC2.Metadata.AWS::CloudFormation::Init
action=/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource EC2 --configsets joomla --region ${AWS::Region}
mode: "000400"
owner: root
group: root
..... 그러나
set_permissions:
commands:
01_01_get_WebServerGroup:
env:
#webserver group might be apache or www-data depending on the distro
WebServerGp:
command: "ps -ef | egrep '(httpd|apache2|apache)' | grep -v `whoami` | grep -v root | head -n1 | awk '{print $1}'"
은의 configsets 과정이 시점에서 중지하고 난에 오류가 다음과 같은 cfn_init.log가 표시됩니다.
File "/usr/lib/python2.7/dist-packages/cfnbootstrap/command_tool.py", line 80, in apply raise ToolError(u"%s does not specify the 'command' attribute, which is required" % name) ToolError: 01_01_get_WebServerGroup does not specify the 'command' attribute, which is required
다음과 같은 grep 결과를 catch하고 사용하는 것이 바람직한 방법입니까? configset 명령? 더 좋은 방법이 있습니까? cfn_init.log에 던져진 오류를 해결하려면 어떻게해야합니까?
OK, 배포시에 배포 유형을 캡처하고 그에 따라 웹 서버 그룹을 설정하기 위해 매개 변수와 매핑 요소를 만들 수 있다고 생각하지만 실제로 cli의 응답에 env : 키를 설정하는 방법을 이해하려고합니다.