https://pulumi.com logo
i

important-sugar-9877

04/04/2022, 12:08 PM
Hello, whats the currently recommended way to use existing ServiceCatalog/Cloudformation templates with pulumi and python? What i have tried so far: 1. The template converter (https://www.pulumi.com/cf2pulumi/) but that leads to a bug https://github.com/pulumi/pulumi-aws-native/issues/429 2. Importing (for example) IAM users with “pulumi import awsiam/userUser…” but the resulting code is missing properties that are present/configurable in my existing template So how would i best go about using an existing IAMUser template, import it into pulumi and pass in the required variables to create different IAM users?
e

echoing-dinner-19531

04/04/2022, 1:16 PM
Importing (for example) IAM users with “pulumi import awsiam/userUser…” but the resulting code is missing properties that are present/configurable in my existing template
That would be an import bug, if you can raise an issue at https://github.com/pulumi/pulumi-aws with a repro for this we could take a look. "import" should codegen for all non-default properties.
i

important-sugar-9877

04/04/2022, 1:48 PM
In the IAMUser template there are 3 variables and a tag, all of them are set when deployed using sceptre. here is there parameters snippet from the existing template
Copy code
...
Parameters:
  UserName:
    Type: String
    Description: A name for the IAM user.
  VariablesJSON:
    Type: String
    Description: A stringified...
    Default: '{"S3BucketName":"s3name"}'
  PolicyName:
    Type: String
    Description: A policy name.
  DMZTag:
    Type: String
    Description: (Optional) Description...
    Default: "NONE"
    AllowedValues:
...
When importing the existing IAMUser using pulumi
Copy code
$ pulumi import aws:iam/user:User user-storage-ro user-storage-ro
this is all the code generated
Copy code
user_storage_ro = aws.iam.User(
"user-storage-ro",
name="user-storage-ro",
opts=pulumi.ResourceOptions(protect=True))
Does that look like a bug that should be reported or am i doing sth wrong / missing sth?
e

echoing-dinner-19531

04/04/2022, 1:55 PM
Yeh that looks like a bug
i

important-sugar-9877

04/04/2022, 1:59 PM
OK, i will report, np.
Got any input on using existing templates with pulumi? 🙂
e

echoing-dinner-19531

04/04/2022, 2:28 PM
No sorry, the recommendation is normally use import but if this resources is bugging out right now that makes things a bit hard.
i

important-sugar-9877

04/04/2022, 2:32 PM
Ok, thx. let me report the bug… 🙂
🙏 1
if you need more info or want me to test sth, please let me know
e

echoing-dinner-19531

04/04/2022, 3:11 PM
Thanks that should be enough to look into it
3 Views