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

update examples to use default providers #1641

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tgummerer
Copy link
Contributor

This is for demonstration purposes only.

## EKS Cluster
with pulumi.default_providers([provider]):
ec2_role, eks_role = iam.setup_iam()
eks_security_group, subnet_ids = vpc.vpc()
Copy link
Member

Choose a reason for hiding this comment

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

This is sort of the interesting bit - and also where "global" approach would run into some problems - I assume the dependent modules would all be loaded and run before we could "install" the default provider?

That said - this does lead to a decent amount more code refactoring to get to something that works?

@@ -1,72 +1,73 @@
from pulumi_aws import config, iam
import json

## EKS Cluster Role
def setup_iam():
Copy link
Member

Choose a reason for hiding this comment

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

This is sort of introducing another new kind of "nesting" - beyond:

  1. Components
  2. Python modules

I suspect in practice we would want to encourage refactoring into components in these cases?

minSize: 1,
maxSize: 2,
let cluster: eks.Cluster | undefined;
pulumi.withDefaultProviders([provider, providerVersioned], () => {
Copy link
Member

Choose a reason for hiding this comment

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

What does this do? How does the code within here consume these two different AWS providers?

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.

2 participants