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

Config log_retention_in_days not working #2079

Open
garganshulgarg opened this issue Oct 30, 2023 · 2 comments
Open

Config log_retention_in_days not working #2079

garganshulgarg opened this issue Oct 30, 2023 · 2 comments

Comments

@garganshulgarg
Copy link

Whenever we are using log_retention_in_days attribute within our chalice configuration we are getting "Feature Unsupported exception"

chalice.package.UnsupportedFeatureError: LogGroup(resource_name='api_handler-log-group', log_group_name='/aws/lambda/xxx-api_handler', retention_in_days=7)

We are using chalice version 1.29.0

@antoine-briand
Copy link

antoine-briand commented Nov 23, 2023

Hi 👋

I'm not sure it's entirely related, but I'm trying to use 'log_retention_in_days': 7, in a chalice project with CDK. When I add this to the stage_config, I get the following error :

RuntimeError: Element referenced in Fn::Sub expression with logical ID: 'ApiHandler' was not found in the template

I'm using chalice==1.29.0 and python 3.10.

        self.chalice = Chalice(
            self,
            'ChaliceApp',
            source_dir=RUNTIME_SOURCE_DIR,
            stage_config={
                'environment_variables': self.environment_variables,
                'lambda_timeout': 900,
                'lambda_memory_size': 256,
                'log_retention_in_days' : 7
            },
        )

@delta1513
Copy link

I get the same error when adding log_retention_in_days to my chalice config. Fairly certain I'm doing this right. Here's my obfuscated config:

{
  "version": "2.0",
  "app_name": "***",
  "automatic_layer": true,
  "stages": {
    "public": {
      "api_gateway_stage": "***",
      "api_gateway_endpoint_type": "REGIONAL",
      "autogen_policy": false,
      "iam_policy_file": "iam-policy.json",
      "subnet_ids": "***",
      "security_group_ids": [ ... ],
      "log_retention_in_days": 731,
      "environment_variables": { ... }
    }
  }
}

Then when I package this (before being run with terraform), I get this error:

chalice.package.UnsupportedFeatureError: LogGroup(resource_name='***', log_group_name='/aws/lambda/***', retention_in_days=731)

The chalice version we are using is 1.29.0 and I've also tried upgrading to 1.31.1 with no luck either 🙁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants