Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stacker_blueprints.iam_user.IAMUser blueprint #52

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions stacker_blueprints/iam_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from stacker.blueprints.base import Blueprint

from troposphere import (
GetAtt,
Output,
Ref,
Sub,
iam,
)


class IAMUser(Blueprint):
"""
Blueprint to create an IAM user.

- class_path: stacker_blueprints.iam_user.IAMUser
name: my-user
variables:
UserName: Bob
Path: /
"""
VARIABLES = {
"UserName": {
"type": str,
"description": "List of ARNs of entities allowed to assume this role",
},
"Path": {
"type": str,
"description": "Provide the path",
"default": "/",
},
}

def create_template(self):
user = self.template.add_resource(
iam.User(**self.get_variables())
)

self.template.add_output(
Output("UserName", Value=Ref(user))
)

self.template.add_output(
Output("UserArn", Value=GetAtt(user, "Arn"))
)