Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 使用Deploy命令生成Cloudformation CLI参数_Amazon Web Services_Amazon S3_Amazon Cloudformation - Fatal编程技术网

Amazon web services 使用Deploy命令生成Cloudformation CLI参数

Amazon web services 使用Deploy命令生成Cloudformation CLI参数,amazon-web-services,amazon-s3,amazon-cloudformation,Amazon Web Services,Amazon S3,Amazon Cloudformation,在cloudformation-deploy中使用cli参数时,我遇到了一个难题。我试图为我要创建的S3 bucket传入名称,当我使用--parameters执行此操作时,cli会抱怨: aws cloudformation deploy --template-file ../infrastructure.yml --stack-name stripe-python --parameters ParameterKey=S3BucketNameParameter,ParameterValue=l

cloudformation-deploy
中使用cli参数时,我遇到了一个难题。我试图为我要创建的S3 bucket传入名称,当我使用
--parameters
执行此操作时,cli会抱怨:

aws cloudformation deploy --template-file ../infrastructure.yml --stack-name stripe-python --parameters ParameterKey=S3BucketNameParameter,ParameterValue=lambda-artifacts-948d01bc80800b36
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: argument subcommand: Invalid choice, valid choices are:

push                                     | register                                
deregister                               | install      

 
当我查看
cloudformation deploy
时,它似乎不支持
--参数
,而是支持
--参数覆盖
,我也尝试过,但没有成功:

aws cloudformation deploy --template-file ../infrastructure.yml --stack-name stripe-python --parameter-overrides S3BucketNameParameter=lambda-artifacts-948d01bc80800b36

An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameters: [S3BucketNameParameter] must have values
所以,我有点被难住了。以下是模板文件的内容:

cat ../infrastructure.yml 
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An AWS Lambda application that calls the Stripe API to tokenize and charge credit cards
Parameters: 
  S3BucketNameParameter: 
    Type: String
    Description: Bucket name for deployment artifacts
Resources:
  S3Bucket:
    Type: AWS::S3::Bucket
    DeletionPolicy: Retain
    Properties:
      BucketName: !Ref S3BucketNameParameter
这里有关于正确方法的建议吗?

这对我很有用:

aws cloudformation deploy --template-file infrastructure.yml --stack-name stripe-python --parameter-overrides S3BucketNameParameter=lambda-artifacts-948d01bc80800b36
它可能归结为awscli版本(即检查您正在运行的版本和文档)

aws cloudformation deploy --template-file infrastructure.yml --stack-name stripe-python --parameter-overrides S3BucketNameParameter=lambda-artifacts-948d01bc80800b36
aws --version
aws-cli/2.0.44 Python/3.8.5 Darwin/18.7.0 source/x86_64