# HKB-PipelineApprover

Approve or reject the pipeline's manual approvals and read its state and change records. No edit rights.

- **Session:** 4 hours. **Accounts:** [Shared Services](/architecture/shared-services/).
- **AWS managed policies:** none.
- **Inline policy:** 10 actions across 3 services (codepipeline, kms, s3).
- **Source:** `bootstrap/hkb-bootstrap-identity.yaml`, resource `PipelineApproverSet`.

## Policy

```yaml
InlinePolicy:
  Version: "2012-10-17"
  Statement:
    - Sid: ApproveOrReject
      Effect: Allow
      Action: codepipeline:PutApprovalResult
      Resource: !Sub arn:${AWS::Partition}:codepipeline:*:${SharedServicesAccountId}:hkb-pipeline-*/*/*
    - Sid: ReadPipeline
      Effect: Allow
      Action:
        - codepipeline:GetPipeline
        - codepipeline:GetPipelineState
        - codepipeline:GetPipelineExecution
        - codepipeline:ListPipelineExecutions
        - codepipeline:ListActionExecutions
      Resource: !Sub arn:${AWS::Partition}:codepipeline:*:${SharedServicesAccountId}:hkb-pipeline-*
    - Sid: ListPipelines
      Effect: Allow
      Action: codepipeline:ListPipelines
      Resource: "*"
    - Sid: ReadChangeRecords
      Effect: Allow
      Action:
        - s3:GetObject
        - s3:GetObjectVersion
      Resource: !Sub arn:${AWS::Partition}:s3:::hkb-pipeline-artifacts-${SharedServicesAccountId}/*
    - Sid: DecryptChangeRecords
      Effect: Allow
      Action: kms:Decrypt
      Resource: !Sub arn:${AWS::Partition}:kms:*:${SharedServicesAccountId}:key/*
      Condition:
        ForAnyValue:StringEquals:
          kms:ResourceAliases: alias/hkb-pipeline
```
