Socket
Socket
Sign inDemoInstall

@aws-cdk/region-info

Package Overview
Dependencies
0
Maintainers
5
Versions
502
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @aws-cdk/region-info

AWS region information, such as service principal names


Version published
Maintainers
5
Created

Changelog

Source

0.32.0 (2019-05-24)

Bug Fixes

  • update all 'onXxx' methods to be CloudWatch Events (#2609) (28942d2), closes #2278
  • appscaling: fix StepScaling (#2522) (1f004f6)
  • aws-ecs: allow linux parameters to be settable (#2397) (417e5e8), closes #2380
  • aws-glue: fix glue tableArn and integer schema name (#2585) (99e173e)
  • cdk: CfnMapping.findInMap with tokens (#2531) (756e2b6), closes #1363
  • cloudfront: Use regional endpoint for S3 bucket origins (64c3c6b)
  • codebuild: correctly pass the VPC subnet IDs to the Policy Statement's condition when using a VPC. (#2506) (145da28), closes #2335
  • codecommit: add a Repository.fromRepositoryName() method. (#2515) (6fc3718), closes #2514
  • codedeploy: change the load balancer API in server Deployment Group. (#2548) (8e05d49), closes #2449
  • codepipeline: correctly validate Artifacts used by Actions in the same Stage. (#2558) (cfe46f6), closes #2549
  • core: Correctly search for loaded modules in node 12 (#2612) (286866a), closes nodejs/node#27583
  • ec2: allow disabling privateDnsEnabled on VPCs (#2596) (4d2fbe9), closes #2556
  • ec2: fix VPC endpoint name for SageMaker Notebooks (#2598) (aec8ec2)
  • iam: allow CompositePrincipal construction with spread (#2507) (eb13741)
  • lambda: compare Runtimes by value instead of identity (#2543) (584579e)
  • lambda: deprecate old Lambda runtimes (#2594) (20f4ec1)
  • route53-targets: move Alias Targets into their own package (#2617) (f40fe98), closes #2448
  • s3: Make IBucket.arnForObject accept only (exactly) one key pattern (5ac6e77)

Code Refactoring

Features

BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • route53-targets: using a CloudFront Distribution or an ELBv2 Load Balancer as an Alias Record Target now requires an integration object from the @aws-cdk/aws-route53-targets package.
  • s3: The IBucket.arnForObject method no longer concatenates path fragments on your behalf. Pass the /-concatenated key pattern instead.
  • All export methods from all AWS resources have been removed. CloudFormation Exports are now automatically created when attributes are referenced across stacks within the same app. To export resources manually, you can explicitly define a CfnOutput.
  • kms: kms.EncryptionKey renamed to kms.Key
  • ec2: ec2.VpcNetwork renamed to ec2.Vpc
  • ec2: ec2.VpcSubnet renamed to ec2.Subnet
  • cloudtrail: cloudtrail.CloudTrail renamed to cloudtrail.Trail`
  • Deleted a few XxxAttribute and XxxImportProps interfaces which were no longer in used after their corresponding export method was deleted and there was no use for them in imports.
  • ecs: ecs.ClusterAttributes now accepts IVpc and ISecurityGroup instead of attributes. You can use their corresponding fromXxx methods to import them as needed.
  • servicediscovery: servicediscovery.CnameInstance.instanceCname renamed to cname.
  • glue: glue.IDatabase.locationUrl is now only in glue.Database (not on the interface)
  • ec2: ec2.TcpPortFromAttribute and UdpPortFromAttribute removed. Use TcpPort and UdpPort with new Token(x).toNumber instead.
  • ec2: ec2.VpcNetwork.importFromContext renamed to ec2.Vpc.fromLookup
  • iam: iam.IRole.roleId has been removed from the interface, but Role.roleId is still available for owned resources.
  • codedeploy: the type of the loadBalancer property in ServerDeploymentGroupProps has been changed.
  • apigateway: apigateway.ResourceBase.trackChild is now internal.
  • cloudfront: cloudfront.S3OriginConfig.originAccessIdentity is now originAccessIdentityId
  • codedeploy: codedeploy.LambdaDeploymentGroup.alarms is now cloudwatch.IAlarm[] (previously cloudwatch.Alarm[])
  • codepipeline: codepipeline.crossRegionScaffoldingStacks renamed to crossRegionScaffolding
  • codepipeline: codepipeline.CrossRegionScaffoldingStack renamed to codepipeline.CrossRegionScaffolding and cannot be instantiated (abstract)
  • ec2: ec2.VpcSubnet.addDefaultRouteToNAT renamed to addDefaultNatRoute and made public
  • ec2: ec2.VpcSubnet.addDefaultRouteToIGW renamed to addDefaultInternetRoute, made public and first argument is the gateway ID (string) and not the CFN L1 class
  • ecs: ecs.Ec2EventRuleTarget.taskDefinition is now ITaskDefinition (previously TaskDefinition)
  • lambda: lambda.IEventSource.bind now accepts IFunction instead of FunctionBase. Use IFunction.addEventSourceMapping to add an event source mapping under the function.
  • lambda: lambda.Layer.grantUsage renamed to lambda.layer.addPermission and returns void
  • stepfunctions: stepfunctions.StateMachine.role is now iam.IRole (previously iam.Role)
  • cloudwatch-events: the events API has been significantly re-worked
    • ⚠️ This new API is still being discussed (see #2609) and might change again in the next release!
    • All onXxx() CloudWatch Event methods now have the signature:
      resource.onEvent('SomeId', {
          target: new SomeTarget(...),
          // options
      });
      
    • CloudWatch:
      • onAlarm was renamed to addAlarmAction
      • onOk was renamed to addOkAction
      • onInsufficientData was renamed to addInsufficientDataAction
    • AutoScaling:
      • onLifecycleTransition was renamed to addLifecycleHook
    • LambdaDeploymentGroup
      • onPreHook was renamed to addPreHook
      • onPostHook was renamed to addPostHook
    • UserPool:
      • all onXxx were renamed to addXxxTrigger
    • Repository:
      • onImagePushed was renamed to onCloudTrailImagePushed
    • Bucket:
      • onEvent was renamed to addEventNotification
      • onObjectCreated was renamed to addObjectCreatedNotification
      • onObjectRemoved was renamed to addObjectRemovedNotification
      • onPutObject was renamed to onCloudTrailPutObject

Readme

Source

AWS Region-Specific Information Directory

Usage

Some information used in CDK Applications differs from one AWS region to another, such as service principals used in IAM policies, S3 static website endpoints, ...

The RegionInfo class

The library offers a simple interface to obtain region specific information in the form of the RegionInfo class. This is the preferred way to interact with the regional information database:

import { RegionInfo } from '@aws-cdk/region-info';

// Get the information for "eu-west-1":
const region = RegionInfo.get('eu-west-1');

// Access attributes:
region.s3StaticWebsiteEndpoint; // s3-website.eu-west-1.amazonaws.com
region.servicePrincipal('logs.amazonaws.com'); // logs.eu-west-1.amazonaws.com

The RegionInfo layer is built on top of the Low-Level API, which is described below and can be used to register additional data, including user-defined facts that are not available through the RegionInfo interface.

Low-Level API

This library offers a primitive database of such information so that CDK constructs can easily access regional information. The FactName class provides a list of known fact names, which can then be used with the RegionInfo to retrieve a particular value:

import regionInfo = require('@aws-cdk/region-info');

const codeDeployPrincipal = regionInfo.Fact.find('us-east-1', regionInfo.FactName.servicePrincipal('codedeploy.amazonaws.com'));
// => codedeploy.us-east-1.amazonaws.com

const staticWebsite = regionInfo.Fact.find('ap-northeast-1', regionInfo.FactName.s3StaticWebsiteEndpoint);
// => s3-website-ap-northeast-1.amazonaws.com

Supplying new or missing information

As new regions are released, it might happen that a particular fact you need is missing from the library. In such cases, the Fact.register method can be used to inject FactName into the database:

regionInfo.Fact.register({
  region: 'bermuda-triangle-1',
  name: regionInfo.FactName.servicePrincipal('s3.amazonaws.com'),
  value: 's3-website.bermuda-triangle-1.nowhere.com',
});

Overriding incorrect information

In the event information provided by the library is incorrect, it can be overridden using the same Fact.register method demonstrated above, simply adding an extra boolean argument:

regionInfo.Fact.register({
  region: 'us-east-1',
  name: regionInfo.FactName.servicePrincipal('service.amazonaws.com'),
  value: 'the-correct-principal.amazonaws.com',
}, true /* Allow overriding information */);

If you happen to have stumbled upon incorrect data built into this library, it is always a good idea to report your findings in a GitHub issue, so we can fix it for everyone else!


This module is part of the AWS Cloud Development Kit project.

Keywords

FAQs

Last updated on 24 May 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc