The AWSFederatedRole CR contains a definition of the desired AWS Role, with both managed and custom Policies included
apiVersion: aws.managed.openshift.io/v1alpha1
kind: AWSFederatedRole
metadata:
name: example-role
namespace: aws-account-operator
spec:
roleDisplayName: Example Role
roleDescription: This is an example Role
# Custom Policy definition
awsCustomPolicy:
name: ExampleCustomPolicy
description: Description of Example Custom Policy
# list of statements for the policy
awsStatements:
- effect: Allow
action:
- "aws-portal:ViewAccount"
- "aws-portal:ViewBilling"
resource:
- "*"
# list of AWS managed
awsManagedPolicies:
- "AWSAccountUsageReportAccess"
- "AmazonEC2ReadOnlyAccess"
- "AmazonS3ReadOnlyAccess"
- "IAMReadOnlyAccess"The AWSFederatedRole controller is triggered when an AWSFederatedRole is created in any namespace. It is responsible for the following behaviors:
- Building AWS
PolicyDoc fromRoledefinition in the spec. - Attempting to validate the Role in AWS by creating the
Role, and deleting it if successful. - Setting the status to
ValidorFailed. - If the status is
ValidorFailed, stop all reconciling. - If an
AWSFederatedRoleis deleted, cleaning up any instances of the Role in AWS by cleaning up anyAWSFederatedAccountAccessesusing theAWSFederatedRole. - If an
AWSFederatedRoleis updated, triggering an update for anyAWSFederatedAccountAccessinstances of that role.
None
spec:
roleDisplayName: Example Role
roleDescription: This is an example Role
# Custom Policy definition
awsCustomPolicy:
name: ExampleCustomPolicy
description: Description of Example Custom Policy
# list of statements for the policy
awsStatements:
- effect: Allow
action:
- "aws-portal:ViewAccount"
- "aws-portal:ViewBilling"
resource:
- "*"
# list of AWS managed
awsManagedPolicies:
- "AWSAccountUsageReportAccess"
- "AmazonEC2ReadOnlyAccess"## 2.2 Account
- "AmazonS3ReadOnlyAccess"
- "IAMReadOnlyAccess"roleDisplayNameis a human-readable name for the Role.roleDescriptionis a human-readable description of what the Role does.awsCustomPolicyis a representation of an AWS Policy to be created as part of the Role. It contains a Policy name, a description, and a list of AWS Statements whichAlloworDenyspecific actions on specific resources.awsManagedPoliciesis a list of AWS pre-defined policies to add to the Role.
conditions:
- lastProbeTime: {Time Stamp}
lastTransitionTime: {Time Stamp}
message: All managed and custom policies are validated
reason: AllPoliciesValid
status: "True"
type: Valid
state: Validconditionsindicates the last states theAWSFederatedRolehad and supporting details. In general, forAWSFederatedRoles, only one condition is expected, and it should match the state.stateis the current state of the CR. Possible values areValidandFailed.
None