I have included the generated sources for the SDK,...
# general
f
I have included the generated sources for the SDK, but am guessing since in automations I don't have an actual Pulumi.yaml I need to also register the package / make it available, etc
e
Nope, just need the SDK. The stuff added to Pulumi.yaml normally is just for tracking so the SDKs can be re-generated again in the future if needed. Everything needed for runtime is inside the SDK itself.
f
So, say: my devops team defines several custom components for ecs (AWS) with things like cloudflare, albs, and security groups all bundled together... If they export the sdk for these components in Java format, I could just import it as a jar with the appropriate additional dependencies in my automation maven project?
e
yes assuming the component plugin itself is accessible, but if its working in a normal program it'll work with automation api as well
f
You mean the AWS and cloudflare plugins? , or also the custom one from my devops team?
e
well all, when they build the custom components if they're building that as a component plugin then they need to distribute that plugin. If they're just defining it as a java library, then it's just a java library. Some more details about component plugins at https://www.pulumi.com/blog/pulumi-components/
Given you said "generated sources for the SDK" sounds like this is a component plugin
f
Ok, assuming it is component plugin, I guess we can't do that via an automation (or at least I couldn't find it in the Java api)
e
pulumi package gen-sdk --language java
to generate the SDK then just add that as a dependency to your automation project
f
When using it as just the published jar, it doesn't work: [71] error: Could not automatically download and install resource plugin 'pulumi-resource-atn-iac-components' at version v0.0.0, install the plugin using `pulumi plugin install resource atn-iac-components v0.0.0`: error downloading provider atn-iac-components to file: failed to download plugin: atn-iac-components-0.0.0: 403 HTTP error fetching plugin from https://get.pulumi.com/releases/plugins/pulumi-resource-atn-iac-components-v0.0.0-linux-amd64.tar.gz
e
Ah you might need
gen-sdk --local --language java
I'd also see if it works on a non-automation project with
pulumi package add
f
what does the
--local
flag do?
Yes, it works if I work from a non-automation project
e
--local changes some of the code generation so the project can be used as a local project dependency rather than a published package It does different things for each target language, I'm not sure if java changes anything but its worth testing because it's what
package add
uses internally
f
Hmm, we already did it with the
--local
flag
e
can you raise an issue on our java repo? This isn't really my area of expertise but I'm sure someone from the team can help with more details
f
k