sparse-intern-71089
11/03/2021, 11:19 AMsalmon-raincoat-19475
11/03/2021, 12:50 PMaws_provider = pulumi_aws.Provider("aws-provider",
profile=self.aws_profile,
region=self.aws_region
)
where self.aws_profile
was pulled from our Pulumi.dev.yaml as the named profile (i.e. sfenman
if you were using your profile)
Then with regards to only saving the state in S3 for the main account, that will require you to do a little coding with a conditional based on if the account is the main account
In python, that would be: (from what I posted in #CRFURDVQB yesterday) -- you'll need to add the conditional logic for only main
bucket = pulumi_aws.s3.get_bucket("my_bucket_name")
source = self.cluster.kubeconfig.apply(lambda s: pulumi.asset.StringAsset(json.dumps(s)))
filename = f'{self.env_stack}-kubeconfig'
pulumi_aws.s3.BucketObject(resource_name=filename,
bucket=bucket.id,
key=f'some/sub_dir/{filename}',
source=source
)
billowy-army-68599
AWS_PROFILE
(or AWS_KEY
etc)
and then set aws:profile
in your stack configNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by