npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@general-galactic/cdk-resources

v1.0.49

Published

Custom resources for AWS CDK. Install this module into your CDK stack: `npm install @general-galactic/cdk-resources` and use the resources as seen below.

Downloads

4

Readme

cdk-resources

Custom resources for AWS CDK. Install this module into your CDK stack: npm install @general-galactic/cdk-resources and use the resources as seen below.

IoTCorePolicy

This resource can be used to manage IoT Core policies. The CDK version of IoT Core policies does not support policy versions. This resource supports version by allowing maintaining the last 5 versions. When you create a new version it is automatically marked as the default version. When you have more than 5 versions the oldest one will be deleted. When destroying your stack, this resouce will delete all of the policy versions and the policy itself.

Here's how to use it:

import { IoTCorePolicy } from '@general-galactic/cdk-resources'

...

// Build your own policy document with all of your topics and allowed actions
 const policy = new PolicyDocument()
    policy.addStatements(new PolicyStatement({
    resources: [
        `arn:aws:iot:${Stack.of(this).region}:${Stack.of(this).account}:client/\${iot:Connection.Thing.ThingName}`
    ],
    actions: [
        'iot:Connect'
    ]
}))

const iotPolicy = new IoTCorePolicy(this, 'testPolicy', policy)

This Resource will create several entities in AWS:

  • Event Handler Lambda: This lambda is used by the resource to perform the actual work of creating, updating, and deleting the policies and versions.
  • Cloudwatch Log Groups: You'll see log groups created for the event handler lambda and the custom resource itself. These logs can assist in troubleshooting.
  • IAM Role: You'll find an IAM role used to execute the Event Handler Lambda. This role will have permissions to execute the lambda and manage policies and policy versions.
  • IoT Core Policy: The policy you are managing.

Do not delete or edit any of these resources outside of your CDK stack or you will cause yourself headaches.

Outputs

  • createdPolicyVersion - The policy version created if a version was created
  • deletedPolicyVersion - The policy version deleted if a version was deleted ( > than 5 versions )
  • policyArn - The ARN of your IoT Core policy

SNSPlatformApplication

This resource can be used to create an SNS Mobile Platform Application to allow sending Apple Push Notifications Service (APNs). In order to use this resource you must first log into the Apple Developer portal and generate a new APNs key. You then need to store the key in AWS Secrets Manager as plain text.

Once you've stored the key in AWS Secrets Manager, you can use this resource to create a Platform Application:

import { SNSPlatformApplicationAPNS } from '@general-galactic/cdk-resources'

...

const apnsPlatformApplication = new SNSPlatformApplicationAPNS(this, '[provide name here]', {
    platform: 'APNS_SANDBOX', // or APNS
    signingKeySecretName: [the name of the signing key secret you stored above],
    signingKeyId: [The signing key ID displayed in the Apple Delveloper Portal],
    appBundleId: [The bundle Id of your iOS app],
    teamId:[The Team ID found in the Apple Developer Portal under 'Membership']
})

This Resource will create several entities in AWS:

  • Event Handler Lambda: This lambda is used by the resource to perform the actual work of creating, updating, and deleting the platform application.
  • Cloudwatch Log Groups: You'll see log groups created for the event handler lambda and the custom resource itself. These logs can assist in troubleshooting.
  • IAM Role: You'll find an IAM role used to execute the Event Handler Lambda. This role will have permissions to execute the lambda, access the secret in Secrets Manager, and manage SNS Platform Applications.
  • SNS Platform Application: The Platform Application you wanted to create.

Do not delete or edit any of these resources outside of your CDK stack or you will cause yourself headaches.

Outputs

  • PlatformApplicationArn - The ARN of the managed SNS Platform Application