首页 > 解决方案 > ParameterOverrides 属性在创建管道时无效 cloudformation

问题描述

我正在使用 AWS Codepipeline 创建一个管道,该管道使用 cloudformation 模板部署 lambda 函数,这是我的模板:


AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31

Parameters:
  ImageUri:
    Type: String
  LambdaName: 
    Type: String
  RoleName:
    Type: String
  DatabaseName:
    Type: String
  DatabasePassword:
    Type: String
  DatabasePort:
    Type: String
  DatabaseURL:
    Type: String
  DatabaseUsername:
    Type: String

Resources:
  LambdaRole:
    Type: AWS::IAM::Role
    Properties:
      RoleName: !Ref RoleName
      AssumeRolePolicyDocument:
        Statement:
          - Action:
            - sts:AssumeRole
            Effect: Allow
            Principal:
              Service:
              - lambda.amazonaws.com
        Version: 2012-10-17
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/AmazonS3FullAccess

  LambdaFunction:
    Type: AWS::Serverless::Function
    Properties:
      FunctionName: !Ref LambdaName
      PackageType: Image
      MemorySize: 256
      Timeout: 5
      ImageUri: !Ref ImageUri
      Environment:
        Variables:
          DATABASE_DATABASE: !Ref DatabaseName
          DATABASE_PASSWORD: !Ref DatabasePassword
          DATABASE_PORT: !Ref DatabasePort
          DATABASE_URL: !Ref DatabaseURL
          DATABASE_USERNAME: !Ref DatabaseUsername
      Role:
        Fn::GetAtt:
          - LambdaRole
          - Arn

我正在尝试在codepipeline部署阶段添加覆盖参数advanced但是当我发布更改时它告诉我

“ParameterOverrides 属性无效”。

有什么帮助吗?!

标签: amazon-web-servicesamazon-cloudformationaws-codepipeline

解决方案


推荐阅读