Does anyone have component created to replace ec2-user in EC2ImageBuilder

0

I'm trying to replace the default user coming from AMI's(ec2-user/ubuntu) to org specific user.

Sripada
asked 7 months ago23 views
1 Answer
0

Hello. You need to create a custom component that runs during the build phase of your image pipeline. Like so:

name: CreateOrgUser
description: "Create a new organization-specific user"
schemaVersion: 1.0

phases:
  - name: build
    steps:
      - name: CreateUser
        action: ExecuteBash
        inputs:
          commands:
            - "sudo adduser --disabled-password --gecos '' orguser"
            - "sudo usermod -aG sudo orguser"
            - "echo 'orguser ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/orguser"

profile picture
EXPERT
answered 2 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions