JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1443
  • Score
    100M100P100Q121073F
  • License Apache-2.0

Package Exports

  • upsert-slr
  • upsert-slr/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (upsert-slr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Upsert Service Linked Role

AWS CDK construct to create a service linked role (SLR) when there is no SLR for the same service, and if any skip the creation process.

Why do we need this?

CloudFormation also supports to create a service linked role (doc). Why do we need this?

Because the resource behaves weirdly when there is already a role with the same name. All we need is to simply create a service linked role if necessary, and skip it if it already exists. Such behavior like upsert is achieved by this construct, upsert-slr.

This construct also waits for some time after creating a role to avoid the delay of IAM propagation.

Usage

npm i upsert-slr
import { ServiceLinkedRole } from 'upsert-slr';

new ServiceLinkedRole(this, 'ElasticsearchSlr', {
    awsServiceName: 'es.amazonaws.com',
    description: 'Service linked role for Elasticsearch',
});