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

Enable autoTrim behavior by default #227

Merged
merged 3 commits into from
Nov 19, 2024
Merged

Enable autoTrim behavior by default #227

merged 3 commits into from
Nov 19, 2024

Conversation

corymhall
Copy link
Contributor

This PR enables the aws-native AutoNaming.autoTrim feature by default.
It does this by creating an aws-native provider by default if the user
does not provide one.

I've updated tests to remove the workarounds.

Alternatives

  1. We could require that the user configure this themselves.
  2. Is there a way to set config values programatically?

closes #62, closes #70

This PR enables the aws-native `AutoNaming.autoTrim` feature by default.
It does this by creating an aws-native provider by default if the user
does not provide one.

I've updated tests to remove the workarounds.

**Alternatives**

1. We could require that the user configure this themselves.
2. Is there a way to set config values programatically?

closes #62, closes #70
src/stack.ts Outdated
const region = native.config.region ?? process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION!;
// If the user has not provided any providers, we will create an aws-native one by default in order
// to enable the autoNaming feature.
const providers = props?.providers ?? [
Copy link
Member

Choose a reason for hiding this comment

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

This could be a bit more precise maybe? If props resets the classic provider, it might still be able to merge in the config for the native provider? Probably a rare use case though, feel free to disregard.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's a good call. I've updated it to handle that case.

@corymhall corymhall enabled auto-merge (squash) November 19, 2024 14:03
@corymhall corymhall merged commit 82ba136 into main Nov 19, 2024
13 checks passed
@corymhall corymhall deleted the corymhall/auto-trim branch November 19, 2024 14:15
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v1.0.0.

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