https://pulumi.com logo
#getting-started
Title
# getting-started
r

refined-painter-68689

07/21/2023, 12:45 AM
Hey folks… I have a somewhat basic question about using Pulumi.yaml and the Golang SDK for which I haven’t been able to find an answer easily. I want to create a Pulumi.yaml file based on some user provided inputs. Then, I want to read it programmatically (Golang), create the resources specified in the yaml file. Common case is that the Pulumi.yaml file will have things like S3 bucket, RDS database, etc. Current documentation around using Pulumi.yaml seems to suggest that there will always be a need for the pulumi cli. And, it will have to do the following (a) pulumi login (b) plum create aws-yaml (c) pulumi create stack, etc. It’ll be great if these initial steps are not required. Agree that they're there for a reason (upgrades, list resources, etc.). But, it'll be cool to simply use the Pulumi golang SDK to create the resources needed based on a given yaml file as input for now. Is this possible?
b

billowy-army-68599

07/21/2023, 1:50 AM
Yep, this is broadly what automation api is for https://www.pulumi.com/automation/
r

refined-painter-68689

07/21/2023, 2:07 AM
Oh.. cool! I had not seen the automation apis. Let me take a look. I already see an examples repo. Awesome!
I was able to try out one of the examples of the inline program shown with the automation API. This is super promising. One follow-up question. I saw that I still needed to create an object specific to an object type. E.g. the code has these lines for creating an S3 bucket:
Copy code
siteBucket, err := s3.NewBucket(ctx, "s3-website-bucket", &s3.BucketArgs{
			Website: s3.BucketWebsiteArgs{
				IndexDocument: pulumi.String("index.html"),
			},
		})
Similarly, if I have to create an RDS instance, I'll have to create a different object for it. Is it possible to NOT have to this specific to each object and simply rely on a
Pulumi.yaml
to have all the required objects and their options set?
b

billowy-army-68599

07/21/2023, 4:01 AM
automation API is the driving mechanism for a Pulumi program the
siteBucket
here is inside the Pulumi program. You can define your pulumi program in any language you want, and drive it using automation api using any other language. Pulumi supports YAML as an authoring mechansm for Pulumi program: https://www.pulumi.com/docs/languages-sdks/yaml/ Which can then be driven from the automation api
r

refined-painter-68689

07/21/2023, 4:03 AM
I see.. thanks! Let me try these things out.