[ASK CLI] Change the CloudFormation deployment bucket for an existing project

ASK CLI(Version 2.2) can not select the Lambda function code deployment bucket on the first deployment. But we […]

広告ここから
広告ここまで

目次

    ASK CLI(Version 2.2) can not select the Lambda function code deployment bucket on the first deployment.

    But we can exchange it after first deployment.

    Where is the definition?

    We can check the bucket definition in the .ask/ask-states.json.

    {
      "askcliStatesVersion": "2020-03-31",
      "profiles": {
        "default": {
          "skillInfrastructure": {
            "@ask-cli/cfn-deployer": {
              "deployState": {
                "default": {
                  "s3": {
                    "bucket": "serverless.us-east-1.example.deploys",
                    "key": "endpoint/build.zip",
    ....

    .s3.bucket is the deployment bucket name.

    How to exchange it?

    That’s simple. just replace the .ask/ask-states.json parameter!

    The following example is replace the deployment bucket name.

    {
      "askcliStatesVersion": "2020-03-31",
      "profiles": {
        "default": {
          "skillInfrastructure": {
            "@ask-cli/cfn-deployer": {
              "deployState": {
                "default": {
                  "s3": {
                    "bucket": "serverless.us-east-1.new.example.deploys",
                    "key": "endpoint/build.zip",
    ....

    Then, the ask deploy command will upload our deployment artifact to the new S3 bucket.

    $ ask deploy
      ⠼ Deploy Alexa skill infrastructure for region "default"
        → Uploading code artifact to s3://serverless.us-east-1.new.example.deploys/endpoint/build.zip

    Bucket key can not updateable

    I’ve try to change the artifact key such as endpoint/build.zip, but it does not work.

    So we can change only deployment S3 bucket name.

    広告ここから
    広告ここまで
    Home
    Search
    Bookmark