Skip to content

feat: add EC2 UserData support for AWS provider#328

Merged
mrizwan93 merged 1 commit intoneoave:mainfrom
mrizwan93:aws-user-data
Mar 26, 2026
Merged

feat: add EC2 UserData support for AWS provider#328
mrizwan93 merged 1 commit intoneoave:mainfrom
mrizwan93:aws-user-data

Conversation

@mrizwan93
Copy link
Copy Markdown
Contributor

Allow passing per-OS user_data from provisioning config to ec2.create_instances(). This enables boot-time instance configuration (e.g. enabling OpenSSH on Windows) without requiring custom AMIs.

in provisioning-config.yaml, user have to define user_data var and provide the set of commands it needs to execute on aws provisioned host like:

aws:
    images:
        win-2025: <image-id>
        win-2022: <image-id>

    flavors:
        default: t3.medium
        ...

    user_data:
        win-2025: |
            <powershell>
            # Set Administrator password (matches ad_admin_password in mhcfg)
            net user Administrator Secret123

            Restart-Service sshd
            </powershell>
        win-2022: |
            <powershell>
            # some commands
            </powershell>

    users:
        win-2025: Administrator
        win-2022: Administrator

@mrizwan93 mrizwan93 force-pushed the aws-user-data branch 2 times, most recently from 7fca8ac to cb7de9c Compare March 16, 2026 10:26
@dav-pascual dav-pascual self-requested a review March 20, 2026 09:42
Copy link
Copy Markdown
Member

@dav-pascual dav-pascual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mrizwan93

Thank you for the changes and you first mrack contribution :)

Apart from other comments:

  • Could you add an example to /src/mrack/data/provisioning-config.yaml for reference?
  • Could you add unit test?

A couple of commit of similar nature (adding new field with transformer/provider update):

Comment thread src/mrack/transformers/aws.py Outdated
@mrizwan93 mrizwan93 force-pushed the aws-user-data branch 3 times, most recently from 1612065 to 4fd7a7d Compare March 23, 2026 13:00
Copy link
Copy Markdown
Member

@dav-pascual dav-pascual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor final comments

Comment thread tests/unit/test_aws_transformer.py Outdated
Comment thread src/mrack/data/provisioning-config.yaml Outdated
@mrizwan93 mrizwan93 force-pushed the aws-user-data branch 3 times, most recently from b89a2a0 to d84e754 Compare March 25, 2026 06:42
Allow passing per-OS user_data from provisioning config to ec2.create_instances().
This enables boot-time instance configuration (e.g. enabling OpenSSH on Windows)
without requiring custom AMIs.

in provisioning-config.yaml, user have to define user_data var and provide the set
of commands it needs to execute on aws provisioned host like:

```
aws:
    images:
        win-2025: <image-id>
        win-2022: <image-id>

    flavors:
        default: t3.medium
        ...

    user_data:
        win-2025: |
            <powershell>
            # Set Administrator password (matches ad_admin_password in mhcfg)
            net user Administrator Secret123

            Restart-Service sshd
            </powershell>
        win-2022: |
            <powershell>
            # some commands
            </powershell>

    users:
        win-2025: Administrator
        win-2022: Administrator
```

Signed-off-by: Rizwan Shaikh <myusuf@redhat.com>
Copy link
Copy Markdown
Member

@dav-pascual dav-pascual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes! LGMT 🙂

@mrizwan93 mrizwan93 merged commit cf48126 into neoave:main Mar 26, 2026
8 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants