Skip to content

Function schedules don't survive 1.17 updateΒ #3042

@koehn

Description

@koehn

Environment information

System:
  OS: macOS 26.0.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 201.11 MB / 32.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 22.21.1 - /opt/homebrew/bin/node
  Yarn: 1.22.22 - /opt/homebrew/bin/yarn
  npm: 10.9.4 - /opt/homebrew/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.8.2
  @aws-amplify/backend: 1.17.0
  @aws-amplify/backend-ai: Not Found
  @aws-amplify/backend-auth: 1.7.2
  @aws-amplify/backend-cli: 1.8.0
  @aws-amplify/backend-data: 1.6.2
  @aws-amplify/backend-deployer: 2.1.3
  @aws-amplify/backend-function: 1.15.0
  @aws-amplify/backend-output-schemas: 1.7.1
  @aws-amplify/backend-output-storage: 1.3.2
  @aws-amplify/backend-secret: 1.4.1
  @aws-amplify/backend-storage: 1.4.2
  @aws-amplify/cli-core: 2.2.1
  @aws-amplify/client-config: 1.8.1
  @aws-amplify/data-construct: 1.16.3
  @aws-amplify/data-schema: 1.21.1
  @aws-amplify/deployed-backend-client: 1.8.1
  @aws-amplify/form-generator: 1.2.4
  @aws-amplify/model-generator: 1.2.1
  @aws-amplify/platform-core: 1.10.2
  @aws-amplify/plugin-types: 1.11.1
  @aws-amplify/sandbox: 2.1.2
  @aws-amplify/schema-generator: 1.4.0
  @aws-cdk/toolkit-lib: 1.1.1
  aws-amplify: 6.15.7
  aws-cdk-lib: 2.221.1
  typescript: 5.9.3
No AWS environment variables
No CDK environment variables

Describe the bug

I have two Amplify Gen 2 functions that run on a schedule; here's one:

export const apiKeyExpirationFunction = defineFunction({
  name: "api-key-expiration-function-" + CDK_CONTEXT["amplify-backend-name"],
  entry: "./api-key-expiration.ts",
  architecture: "arm64",
  memoryMB: 512,
  runtime: 22,
  schedule: "0 9 * * ? *",
});

After upgrading to @aws-amplify/backend 1.17.0 and deploying with the standard amplify deploy (npx ampx pipeline-deploy) or to the sandbox (npx ampx sandbox), I get the following error:

amplify-[redacted]-main-branch-aee3feed3f |   0 | 3:09:47 PM | UPDATE_FAILED | AWS::CloudFormation::Stack | function.NestedStack/function.NestedStackResource (function1351588B) Update of resource type is not permitted. The new template modifies resource type of the following resources: [usagereportfunctionmainlambdaschedule07CE72C09, apikeyexpirationfunctionmainlambdaschedule09DAE100A]

If I comment out the schedule and deploy, the deployment succeeds and the schedule is deleted from the function. If I then un-comment the schedule and deploy, the (presumably new) schedule deploys correctly. It appears to not manage upgrading the schedule from pre-1.17, but can deploy new ones successfully.

Reproduction steps

  1. Deploy with @aws-amplify/backend 1.16.1 an amplify function with a schedule
  2. Upgrade to @aws-amplify/backend 1.17.0
  3. Deploy again; deployment will fail with message, Update of resource type is not permitted. The new template modifies resource type of the following resources: [ <resource> ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending-triageIncoming issues that need categorization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions