> **Page index:** https://km.oslo.systems/llms.txt lists every page on this site, with a link to its Markdown version.

# Maskinporten

Set up the Maskinporten integration role for applications that use Maskinporten. Configured via the `iam` package.

## Step 1: Add and configure the `iam` package

repo-iac/environments/dev/

```
ok pkg add iam
```

In `package-config.yml`, enable `MaskinportenKeyRotation`:

iam/package-config.yml

```
StackName: "iam"
MaskinportenKeyRotation:
  Enable: true
```

> [!WARNING]
>
> **Only one per account**
>
> You can only have one **MaskinportenKeyRotation** enabled per account. If already enabled in a different environment, you cannot enable it here.
>
> Enabling it will cause an error when applying the stack.

## Step 2: Install and apply the package

iam/

```
ok pkg install
terraform init
terraform apply
```

## Step 3: Verify

```
aws iam list-roles | jq '.Roles[].RoleName' | grep dataplatform-maskinporten
```

Output should contain role `dataplatform-maskinporten`.

In **IAM**, select **Roles** and search for `dataplatform-maskinporten`.

List should contain role `dataplatform-maskinporten`.
