Hello Pulumians, Is there a way we can host our o...
# general
s
Hello Pulumians, Is there a way we can host our own custom Resources or collection of Custom resources within Pulumi? Example Use case: I want all developers within my org be default: 1. create S3 buckets which is encrypted with a KMS key 2. Create an EC2 with one of the Golden AMIs
a
Are you talking about resource encapsulation? Pulumi components are similar to Terraform modules. That, and/or you could make a stack containing those resources per dev? Sorry if I've misunderstood!
e
Yeh component resources are the way to do this. You can either just make a library if you only need one language (Pulumi python code is just python for example) We've also got some support for multi-language components where your write the component in Python for example but can use it from Go/TypeScript/etc. See https://github.com/pulumi/pulumi-component-provider-py-boilerplate for a starter example. We've got plans to improve both the authoring and publishing of components over the coming year.
s
Ok, so that means Component Resources are like libraries that I can write once and have my team use that? With this I can put all the best practices in there and have the team re-use it for their projects. Correct?
s
Im not sure if Crosswalk supports us to host our custom well architected patterns
e
CrossWalk is just a set of components that Pulumi wrote
s
So here's my use case: As an Cloud-enablement team i would like to provide a framework to our developers so that they can provision their own infrastructure. Our developers are not be aware of all the best practices.. So I would like to create custom pre-baked secured libraries. An S3 bucket which is kms encrypted by default, Or an Ec2 which has securitygroup baked with certain restrictions and only allows certain AMIs. The developers will import these custom libraries to provision infra . Which ensures secured and best practices from day 0
Will component resources allow combing multiple resources?
@echoing-dinner-19531 I hope I was able to explain my use-case
e
Yes component resources are nearly always multiple resources (although they don't have to be) e.g. the crosswalk Vpc component sets up an aws vpc, but also an internetGateway and subnets: https://github.com/pulumi/pulumi-awsx/blob/master/awsx/ec2/vpc.ts