Skip to content

Commit

Permalink
[actors.aws.entities] Bugfix the IAM Role Creation actor (#519)
Browse files Browse the repository at this point in the history
* [actors.aws.entities] Bugfix the IAM Role Creation actor

I was passing in a string rather than a string-pointer to a file, and
that's not what the input was expecting. This is a simpler fix.

* Fix unquoted docs language

Co-authored-by: Scott Smitelli <[email protected]>
  • Loading branch information
diranged and Scott Smitelli authored Jul 1, 2022
1 parent e06bd57 commit a312482
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
19 changes: 15 additions & 4 deletions kingpin/actors/aws/iam/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ class Role(EntityBaseActor):
),
"assume_role_policy_document": (
str,
'{"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Principal": {"Service": "ec2.amazonaws.com"}, "Action": "sts:AssumeRole" }]}',
None,
("The policy that grants an entity" "permission to assume the role"),
),
}
Expand All @@ -909,9 +909,20 @@ def __init__(self, *args, **kwargs):
self._parse_inline_policies(self.option("inline_policies"))

# Pre-parse the Assume Role Policy Document if it was supplied
self.assume_role_policy_doc = self._parse_policy_json(
self.option("assume_role_policy_document")
)
self.assume_role_policy_doc = {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole",
}
],
}
if self.option("assume_role_policy_document") is not None:
self.assume_role_policy_doc = self._parse_policy_json(
self.option("assume_role_policy_document")
)

@gen.coroutine
def _ensure_assume_role_doc(self, name):
Expand Down
2 changes: 1 addition & 1 deletion kingpin/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# Copyright 2018 Nextdoor.com, Inc


__version__ = "2.0.2"
__version__ = "2.0.3"

0 comments on commit a312482

Please sign in to comment.