0.3.111 • Published 6 days ago

@amazon-codecatalyst/blueprint-component.environments v0.3.111

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 days ago
import {...} from '@amazon-codecatalyst/blueprint-component.environments'

The environment component can be found here.

The blueprint wizard is dynamically generated from the Options interface exposed through the [wizard|https://github.com/aws/codecatalyst-blueprints/wiki/Wizard]. Blueprints supports generating UI components from exposed types.

Example 1: Creating development environments

export interface Options extends ParentOptions {
    ...
    myNewEnvironment:  EnvironmentDefinition<{
        thisIsMyFirstAccountConnection: AccountConnection<{
            thisIsARole: Role<['lambda', 's3', 'dynamo']>;
        }>;
    }>;
}

This allows authors to deploy their applications to the cloud.

The above interface will generate a UI component that asks for a new Environment myNewEnvironment with a single account connection thisIsMyFirstAccountConnection and a role on that account connection thisIsARole with ['lambda', 's3', 'dynamo'] as the minimum required role capabilities. Since not all users will have account connections, it is important to check for the case where a user does not connect an account, and does not connect an account with a role either. This is reflected accurately in the type definition.

Roles can also be annotated with @inlinePolicies per the documentation here.

The environment component requires a name and an environmentType. The minimal required default shape looks like this:

{
  ...
  "myNewEnvironment": {
    "name": "myProductionEnvironment",
    "environmentType": "PRODUCTION"
  },
}

The UI component will then prompt the user for various fields and as they fill in those fields the blueprint will get a fully expanded shape. It is sometimes helpful to include the full 'mock' (see the below examples) in the defaults.json for testing and development purposes.

Example 2: A simple mock interface

{
    ...
    "thisIsMyEnvironment": {
        "name": "myProductionEnvironment",
        "environmentType": "PRODUCTION",
        "thisIsMySecondAccountConnection": {
            "id": "12345678910",
            "name": "my-account-connection-name",
            "secondAdminRole": {
                "arn": "arn:aws:iam::12345678910:role/ConnectedCodecatalystRole",
                "name": "ConnectedCodecatalystRole",
                "capabilities": [
                    "lambda",
                    "s3",
                    "dynamo"
                ]
            }
        }
    }
}

Example 3: A more complicated mock interface

export interface Options extends ParentOptions {
  /**
   * The name of an environment
   * @displayName This is a Environment Name
   * @collapsed
   */
  thisIsMyEnvironment: EnvironmentDefinition<{
    /**
     * blah blah blah some comments about the account that i'm deploying into
     * @displayName This account connection has an overriden name
     * @collapsed
     */
    thisIsMyFirstAccountConnection: AccountConnection<{
      /**
       * Blah blah some information about the role that I expect
       * e.g. here's a copy-pastable policy: [to a link]
       * @displayName This role has an overriden name
       */
      adminRole: Role<['admin', 'lambda', 's3', 'cloudfront']>;
      /**
       * Blah blah some information about the second role that I expect
       * e.g. here's a copy-pastable policy: [to a link]
       */
      lambdaRole: Role<['lambda', 's3']>;
    }>;
    /**
     * blah blah blah some comments about the account that i'm deploying into
     */
    thisIsMySecondAccountConnection: AccountConnection<{
      /**
         * Blah blah some information about the role that I expect
         * e.g. here's a copy-pastable policy: [to a link]
         */
      secondAdminRole: Role<['admin', 'lambda', 's3', 'cloudfront']>;
      /**
         * Blah blah some information about the second role that I expect
         * e.g. here's a copy-pastable policy: [to a link]
         */
      secondLambdaRole: Role<['lambda', 's3']>;
    }>;
  }>;
}

Example 4: A complete mock interface

{
  ...
  "thisIsMyEnvironment": {
    "name": "my-production-environment",
    "environmentType": "PRODUCTION",
    "thisIsMySecondAccountConnection": {
      "id": "12345678910",
      "name": "my-connected-account",
      "secondAdminRole": {
        "name": "LambdaCodecatalystRole",
        "arn": "arn:aws:iam::12345678910:role/LambdaCodecatalystRole",
        "capabilities": [
          "admin",
          "lambda",
          "s3",
          "cloudfront"
        ]
      },
      "secondLambdaRole": {
        "name": "LambdaCodecatalystRole",
        "arn": "arn:aws:iam::12345678910:role/LambdaCodecatalystRole",
        "capabilities": [
          "lambda",
          "s3"
        ]
      }
    },
    "thisIsMyFirstAccountConnection": {
      "id": "12345678910",
      "name": "my-connected-account",
      "adminRole": {
        "name": "LambdaCodecatalystRole",
        "arn": "arn:aws:iam::12345678910:role/LambdaCodecatalystRole",
        "capabilities": [
          "admin",
          "lambda",
          "s3",
          "cloudfront"
        ]
      },
      "lambdaRole": {
        "name": "LambdaCodecatalystRole",
        "arn": "arn:aws:iam::12345678910:role/LambdaCodecatalystRole",
        "capabilities": [
          "lambda",
          "s3"
        ]
      }
    }
  },
}
0.3.111

6 days ago

0.3.110

11 days ago

0.3.109

14 days ago

0.3.108

14 days ago

0.3.107

17 days ago

0.3.105

19 days ago

0.3.106

19 days ago

0.3.103

20 days ago

0.3.104

20 days ago

0.3.101

21 days ago

0.3.102

21 days ago

0.3.100

24 days ago

0.3.99

24 days ago

0.3.98

25 days ago

0.3.97

26 days ago

0.3.96

27 days ago

0.3.95

28 days ago

0.3.94

1 month ago

0.3.93

1 month ago

0.3.92

1 month ago

0.3.91

1 month ago

0.3.90

1 month ago

0.3.89

1 month ago

0.3.88

1 month ago

0.3.87

1 month ago

0.3.86

1 month ago

0.3.85

1 month ago

0.3.84

2 months ago

0.3.82

2 months ago

0.3.81

2 months ago

0.3.79

2 months ago

0.3.80

2 months ago

0.3.78

2 months ago

0.3.77

2 months ago

0.3.76

2 months ago

0.3.75

2 months ago

0.3.74

2 months ago

0.3.73

2 months ago

0.3.72

2 months ago

0.3.71

2 months ago

0.3.70

2 months ago

0.3.69

2 months ago

0.3.68

2 months ago

0.3.67

2 months ago

0.3.66

2 months ago

0.3.65

2 months ago

0.3.64

2 months ago

0.3.63

2 months ago

0.3.62

2 months ago

0.3.61

2 months ago

0.3.60

3 months ago

0.3.59

3 months ago

0.3.58

3 months ago

0.3.57

3 months ago

0.3.53

3 months ago

0.3.52

3 months ago

0.3.55

3 months ago

0.3.54

3 months ago

0.3.51

3 months ago

0.3.50

3 months ago

0.3.49

4 months ago

0.3.48

4 months ago

0.3.47

4 months ago

0.3.46

4 months ago

0.3.42

4 months ago

0.3.41

4 months ago

0.3.45

4 months ago

0.3.44

4 months ago

0.3.43

4 months ago

0.3.40

4 months ago

0.3.39

4 months ago

0.3.38

4 months ago

0.3.37

4 months ago

0.3.36

4 months ago

0.3.35

5 months ago

0.3.34

5 months ago

0.3.33

5 months ago

0.3.31

5 months ago

0.3.32

5 months ago

0.3.30

5 months ago

0.3.29

5 months ago

0.3.28

6 months ago

0.3.27

6 months ago

0.3.26

6 months ago

0.3.25

6 months ago

0.3.24

6 months ago

0.3.23

6 months ago

0.3.22

6 months ago

0.3.21

7 months ago

0.3.20

7 months ago

0.3.19

7 months ago

0.3.18

7 months ago

0.3.17

7 months ago

0.3.16

7 months ago

0.3.15

7 months ago

0.3.14

7 months ago

0.3.13

7 months ago

0.3.12

7 months ago

0.3.11

7 months ago

0.3.10

7 months ago

0.3.9

7 months ago

0.3.8

7 months ago

0.3.7

7 months ago

0.3.6

7 months ago

0.3.5

7 months ago

0.3.4

7 months ago

0.3.3

7 months ago

0.3.2

7 months ago

0.3.1

7 months ago

0.3.0

7 months ago

0.0.0

7 months ago