为什么我从第一个模板中获取错误

发布于 2025-02-05 04:43:59 字数 839 浏览 1 评论 0 原文

为什么每次尝试替换当前模板时都会收到这些错误。 [/resources/webserversecuritygroup/type/groupDescription]“ null”值也不允许在模板中

,以下是我的.YAML代码。

AWSTemplateFormatVersion: 2010-09-09
Description: My First Template in CloudFormation Course
Resources: 
 WebServerInstance:
  Type: AWS::EC2::Instance
  Properties: 
    ImageId: ami-0c1bc246476a5572b
    InstanceType: t2.micro
    Tags:
     -
      Key: Name
      Value: Web Server
     -
      Key: Project
      Value: CloudFormation Step By Step
 WebServerSecurityGroup: 
  Type: AWS::EC2::SecurityGroup
  Properties: 
    GroupDescription: 
    SecurityGroupIngress: 
     - 
       IpProtocol: "tcp"
       FromPort: 80
       ToPort: 80
       CidrIp: "0.0.0.0/0" 
    Tags: 
     -
      Key: Name 
      Value: Web Server Security Group 

Why do I get these errors every time I try to replace a current template.
[/Resources/WebServerSecurityGroup/Type/GroupDescription] 'null' values are not allowed in templates

Also, below is my .yaml code.

AWSTemplateFormatVersion: 2010-09-09
Description: My First Template in CloudFormation Course
Resources: 
 WebServerInstance:
  Type: AWS::EC2::Instance
  Properties: 
    ImageId: ami-0c1bc246476a5572b
    InstanceType: t2.micro
    Tags:
     -
      Key: Name
      Value: Web Server
     -
      Key: Project
      Value: CloudFormation Step By Step
 WebServerSecurityGroup: 
  Type: AWS::EC2::SecurityGroup
  Properties: 
    GroupDescription: 
    SecurityGroupIngress: 
     - 
       IpProtocol: "tcp"
       FromPort: 80
       ToPort: 80
       CidrIp: "0.0.0.0/0" 
    Tags: 
     -
      Key: Name 
      Value: Web Server Security Group 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦毁影碎の 2025-02-12 04:44:00

aws :: ec2 :: SecurityGroup 上的属性 groupDescription 是必需的,但是您在的yaml规范中将其固定为空AWS :: EC2 :: SecurityGroup

您必须在其中指定不超过255个字符的字符串,该字符非正式地描述了您的安全组。此属性不得为空/空。

A value for the property GroupDescription on the AWS::EC2::SecurityGroup is required, but you left it empty in your YAML specification of the AWS::EC2::SecurityGroup.

You must specify a string of not more than 255 characters there which describes your security group informally. This property must not be empty/null.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文