如何在 LaunchTemplate 中使用 cfn-init?这适用于 EC2 实例、自动扩展组中的 ECS 集群。
Metadata
实例的部分在哪里,--resource
传递给 cnf-init 的内容是什么?
LaunchTemplate:
Type: AWS::EC2::LaunchTemplate
Properties:
LaunchTemplateName: !Sub ${AWS::StackName}-launch-template
LaunchTemplateData:
SecurityGroups:
- !Ref DMZSecurityGroup
- !Ref ECSSecurityGroup
UserData:
Fn::Base64:
!Sub |
#!/bin/bash -xe
yum update -y aws-cfn-bootstrap
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource ??? --region ${AWS::Region}
yum -y update
Run Code Online (Sandbox Code Playgroud)
我对元数据的最佳猜测产生了错误:
Property validation failure: [Encountered unsupported properties in {/LaunchTemplateData}: [Metadata]]
Run Code Online (Sandbox Code Playgroud) amazon-ec2 amazon-web-services amazon-ecs aws-cloudformation
XSL如何使用XSL为XML文档中的每个元素生成唯一的id属性,其中id必须是数字?下面的XLS工作,除了生成的ID是字母数字,我需要数字?
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:msxsl='urn:schemas-microsoft-com:xslt' exclude-result-prefixes='msxsl'>
<xsl:output method='xml' indent='yes'/>
<xsl:template match='*'>
<xsl:copy>
<xsl:attribute name='ElementID'>
<xsl:value-of select='generate-id()'/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
谢谢.
如何使用可选参数pls创建电源查询功能?我尝试了各种创建函数语法的排列,目前如下:
let
fnDateToFileNameString=(inFileName as text, inDate as date, optional inDateFormat as nullable text) =>
let
nullCheckedDateFormat = Text.Replace(inDateFormat, null, ""),
value = if nullCheckedDateFormat = ""
then inFileName
else Text.Replace(inFileName, inDateFormat, Date.ToText(inDate, inDateFormat ))
in
value
in
fnDateToFileNameString
Run Code Online (Sandbox Code Playgroud)
我将它传递给一个看起来像的测试:
= fnDateToFileNameString("XXXXXXXXXXXXXXXXXX", #date(2015, 3, 21), null)
Run Code Online (Sandbox Code Playgroud)
抛出:
"An error occurred in the fnDateToFileNameString" query. Expression.Error: we cannot convert the value null to type Text.
Details:
Value=
Type=Type
Run Code Online (Sandbox Code Playgroud)