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

feat(static-website): allow empty params #217

Merged
merged 2 commits into from
May 31, 2022

Conversation

fargito
Copy link
Contributor

@fargito fargito commented May 30, 2022

Follow-up of #213 which was unfortunately closed

What I need to do is parametrize some of my config:

  constructs: {
    app: {
      type: 'static-website',
      path: '../build',
      errorPage: '404.html',
      domain: '${param:domain}',
      redirectToMainDomain: '${param:redirectToMainDomain}',
      certificate: '${param:certificate}',
    },
  },

However if I try to setup my params with null values, they get cleaned out from stage params.

  params: {
    dev: {
      domain: [],
      redirectToMainDomain: false,
      certificate: null, // issue here
    },
    production: {
      domain: ['www.mywebsite.com', 'mywebsite.com'],
      redirectToMainDomain: true,
      certificate: 'my-certificate-arn',
    },
  },

If I do this, I get the following error:
image

And if I try to put the params like:

  params: {
    dev: {
      domain: [],
      redirectToMainDomain: false,
      certificate: '' // with an empty string
    },
    production: {
      domain: ['www.mywebsite.com', 'mywebsite.com'],
      redirectToMainDomain: true,
      certificate: 'my-certificate-arn',
    },
  },

I get the following error:
image

This PR adds the possibility to pass empty arguments for certificate and domain configurations.

Copy link
Member

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for me 👍

@mnapoli mnapoli merged commit 1f61b86 into getlift:master May 31, 2022
@fargito fargito deleted the feat/empty-static-website-params branch May 31, 2022 13:35
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

Successfully merging this pull request may close these issues.

None yet

2 participants