Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: sam validate fail when using SecondsUntilAutoPause in a AWS::RDS::DBCluster #7816

Open
MrLesh opened this issue Dec 31, 2024 · 2 comments
Labels
stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Comments

@MrLesh
Copy link

MrLesh commented Dec 31, 2024

Description:

In my template.yaml file I'm configuring a AWS::RDS::DBCluster with engine: aurora-postgresql and ServerlessV2ScalingConfiguration
in ServerlessV2ScalingConfiguration I'm trying to use SecondsUntilAutoPause to set it to 900 seconds
When running sam validate - the validation failed with error:
[E3002: Resource properties are invalid] (Additional properties are not allowed ('SecondsUntilAutoPause' was unexpected)) matched 83]

Steps to reproduce:

In your template.yaml file add AWS::RDS::DBCluster with engine: aurora-postgresql
Use ServerlessV2ScalingConfiguration to define serverless V2, and under it define SecondsUntilAutoPause: 300

Observed result:

[[E3002: Resource properties are invalid] (Additional properties are not allowed ('SecondsUntilAutoPause' was unexpected)) matched 83]

Expected result:

Validation passs

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Windows
  2. sam --version: 1.132.0
  3. AWS region: eu-central-1
{
  "version": "1.132.0",
  "system": {
    "python": "3.12.6",
    "os": "Windows-11-10.0.22631-SP0"
  },
  "additional_dependencies": {
    "docker_engine": "Not available",
    "aws_cdk": "Not available",
    "terraform": "Not available"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
}

Add --debug flag to command you are running

@MrLesh MrLesh added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Dec 31, 2024
@Vandita2020
Copy link

Hey @MrLesh, thanks for reaching out. Auto-pause is a new feature and I want to make sure that you're using the right Aurora PostgreSQL version. It is supported on the engine version starting 13.15. More details are mentioned here. Can you please share the engine version you are currently using to help solve the issue in more detail.

@MrLesh
Copy link
Author

MrLesh commented Jan 5, 2025

hi @Vandita2020 and thanks for the reply.
in our template.yaml we are not declaring any version but using the default one, so it looks like this:

    Type: AWS::RDS::DBCluster
    DeletionPolicy: Delete
    Properties:
      DatabaseName: ****
      DBClusterIdentifier: !Join
        - ''
        - - !Ref resourceNamePrefix
          - '-dbcluster'
      DBSubnetGroupName: !Ref DBSubnetGroup
      Engine: aurora-postgresql
      EnableHttpEndpoint: true
      #StorageEncrypted: true
      MasterUsername: !Sub "{{resolve:secretsmanager:${DBSecretARN}:SecretString:username}}"
      MasterUserPassword: !Sub "{{resolve:secretsmanager:${DBSecretARN}:SecretString:password}}"
      Port: ****
      ServerlessV2ScalingConfiguration:
        MaxCapacity: 1.0
        MinCapacity: 0.5
      VpcSecurityGroupIds:
        - !Ref DBSecurityGroup 

so when deploying this the default version is 15.4 (which is not supported).
To make it work I had to add:
EngineVersion: '15.7'
and reduce the MinCapacity to 0. then the validation passed and I was able to deploy.
When adding to that "SecondsUntilAutoPause" the validation failes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

No branches or pull requests

2 participants