cdk-preinstalled-amazon-linux-ec2 0.0.0__tar.gz → 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. cdk-preinstalled-amazon-linux-ec2-0.0.2/PKG-INFO +115 -0
  2. cdk-preinstalled-amazon-linux-ec2-0.0.2/README.md +92 -0
  3. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/setup.py +2 -2
  4. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/src/cdk_preinstalled_amazon_linux_ec2/__init__.py +92 -1
  5. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/src/cdk_preinstalled_amazon_linux_ec2/_jsii/__init__.py +2 -2
  6. cdk-preinstalled-amazon-linux-ec2-0.0.2/src/cdk_preinstalled_amazon_linux_ec2/_jsii/cdk-preinstalled-amazon-linux-ec2@0.0.2.jsii.tgz +0 -0
  7. cdk-preinstalled-amazon-linux-ec2-0.0.2/src/cdk_preinstalled_amazon_linux_ec2.egg-info/PKG-INFO +115 -0
  8. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/src/cdk_preinstalled_amazon_linux_ec2.egg-info/SOURCES.txt +1 -1
  9. cdk-preinstalled-amazon-linux-ec2-0.0.0/PKG-INFO +0 -24
  10. cdk-preinstalled-amazon-linux-ec2-0.0.0/README.md +0 -1
  11. cdk-preinstalled-amazon-linux-ec2-0.0.0/src/cdk_preinstalled_amazon_linux_ec2/_jsii/cdk-preinstalled-amazon-linux-ec2@0.0.0.jsii.tgz +0 -0
  12. cdk-preinstalled-amazon-linux-ec2-0.0.0/src/cdk_preinstalled_amazon_linux_ec2.egg-info/PKG-INFO +0 -24
  13. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/LICENSE +0 -0
  14. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/MANIFEST.in +0 -0
  15. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/pyproject.toml +0 -0
  16. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/setup.cfg +0 -0
  17. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/src/cdk_preinstalled_amazon_linux_ec2/py.typed +0 -0
  18. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/src/cdk_preinstalled_amazon_linux_ec2.egg-info/dependency_links.txt +0 -0
  19. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/src/cdk_preinstalled_amazon_linux_ec2.egg-info/requires.txt +0 -0
  20. {cdk-preinstalled-amazon-linux-ec2-0.0.0 → cdk-preinstalled-amazon-linux-ec2-0.0.2}/src/cdk_preinstalled_amazon_linux_ec2.egg-info/top_level.txt +0 -0
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.1
2
+ Name: cdk-preinstalled-amazon-linux-ec2
3
+ Version: 0.0.2
4
+ Summary: CDK Construct for creating an Amazon Linux EC2 instance with pre-installed software
5
+ Home-page: https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git
6
+ Author: Kazuho CryerShinozuka<malaysia.cryer@gmail.com>
7
+ License: Apache-2.0
8
+ Project-URL: Source, https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: JavaScript
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Typing :: Typed
18
+ Classifier: Development Status :: 5 - Production/Stable
19
+ Classifier: License :: OSI Approved
20
+ Requires-Python: ~=3.8
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+
24
+ # CDK Preinstalled Amazon Linux EC2 Instance Construct
25
+
26
+ This is a CDK Construct for creating a preinstalled AmazonLinux EC2 instance.
27
+
28
+ You can use Node.js, Visual Studio Code, git and other software as soon as the EC2 instance starts.
29
+
30
+ [![View on Construct Hub](https://constructs.dev/badge?package=cdk-preinstalled-amazon-linux-ec2)](https://constructs.dev/packages/cdk-preinstalled-amazon-linux-ec2)
31
+
32
+ [![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc)](https://open.vscode.dev/badmintoncryer/cdk-preinstalled-amazon-linux-ec2)
33
+ [![npm version](https://badge.fury.io/js/cdk-preinstalled-amazon-linux-ec2.svg)](https://badge.fury.io/js/cdk-preinstalled-amazon-linux-ec2)
34
+ [![Build Status](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/build.yml/badge.svg)](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/build.yml)
35
+ [![Release Status](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/release.yml/badge.svg)](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/release.yml)
36
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
37
+ [![npm downloads](https://img.shields.io/npm/dm/cdk-preinstalled-amazon-linux-ec2.svg?style=flat)](https://www.npmjs.com/package/cdk-preinstalled-amazon-linux-ec2)
38
+
39
+ ## Usage
40
+
41
+ Install the package:
42
+
43
+ ```bash
44
+ npm install cdk-preinstalled-amazon-linux-ec2
45
+ ```
46
+
47
+ Use it in your CDK stack:
48
+
49
+ ```python
50
+ import { PreinstalledAmazonLinuxInstance } from 'cdk-preinstalled-amazon-linux-ec2';
51
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
52
+
53
+ declare const vpc: ec2.IVpc;
54
+
55
+ // You can configure all properties of the EC2 instance
56
+ new PreinstalledAmazonLinuxInstance(this, 'Instance', {
57
+ vpc,
58
+ instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.NANO),
59
+ machineImage: new ec2.AmazonLinuxImage({
60
+ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023,
61
+ }),
62
+ // Specify preinstalled software
63
+ preinstalledSoftware: {
64
+ type: [
65
+ PreinstalledSoftwareType.NODEJS,
66
+ PreinstalledSoftwareType.VSCODE,
67
+ PreinstalledSoftwareType.GIT,
68
+ ],
69
+ others: ['rsyslog'], // You can specify other software packages. These parameters are used as `sudo dnf install ${parameter}`
70
+ });
71
+ ```
72
+
73
+ After the stack is deployed, you can SSH into the EC2 instance and use Node.js:
74
+
75
+ ```bash
76
+ $ ssh ec2-user@<public-ip>
77
+ $ node --version
78
+ v20.13.1
79
+ $ code --version
80
+ 1.89.1
81
+ $ git --version
82
+ git version 2.39.3
83
+ ```
84
+
85
+ ## user data
86
+
87
+ Installation of software is done by user data script. You can see the script in the `src/index.ts` file.
88
+
89
+ ```python
90
+ // Install Node.js
91
+ userData.addCommands(
92
+ 'touch ~/.bashrc',
93
+ 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash',
94
+ 'source ~/.bashrc',
95
+ 'export NVM_DIR="$HOME/.nvm"',
96
+ '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"',
97
+ `nvm install ${props.nodeJsVersion ?? '--lts'}`,
98
+ // Note that the above will install nvm, node and npm for the root user.
99
+ // It will not add the correct ENV VAR in ec2-user's environment.
100
+ `cat <<EOF >> /home/ec2-user/.bashrc
101
+ export NVM_DIR="/.nvm"
102
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
103
+ EOF`);
104
+ ```
105
+
106
+ Ofcourse, you can customize the additional user data script by calling `instance.userData.addCommands()` method.
107
+
108
+ ```python
109
+ declare const instance: PreinstalledAmazonLinuxInstance;
110
+
111
+ // install Postgresql
112
+ instance.userData.addCommands(
113
+ 'sudo dnf install -y postgresql15-server'
114
+ );
115
+ ```
@@ -0,0 +1,92 @@
1
+ # CDK Preinstalled Amazon Linux EC2 Instance Construct
2
+
3
+ This is a CDK Construct for creating a preinstalled AmazonLinux EC2 instance.
4
+
5
+ You can use Node.js, Visual Studio Code, git and other software as soon as the EC2 instance starts.
6
+
7
+ [![View on Construct Hub](https://constructs.dev/badge?package=cdk-preinstalled-amazon-linux-ec2)](https://constructs.dev/packages/cdk-preinstalled-amazon-linux-ec2)
8
+
9
+ [![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc)](https://open.vscode.dev/badmintoncryer/cdk-preinstalled-amazon-linux-ec2)
10
+ [![npm version](https://badge.fury.io/js/cdk-preinstalled-amazon-linux-ec2.svg)](https://badge.fury.io/js/cdk-preinstalled-amazon-linux-ec2)
11
+ [![Build Status](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/build.yml/badge.svg)](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/build.yml)
12
+ [![Release Status](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/release.yml/badge.svg)](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/release.yml)
13
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
14
+ [![npm downloads](https://img.shields.io/npm/dm/cdk-preinstalled-amazon-linux-ec2.svg?style=flat)](https://www.npmjs.com/package/cdk-preinstalled-amazon-linux-ec2)
15
+
16
+ ## Usage
17
+
18
+ Install the package:
19
+
20
+ ```bash
21
+ npm install cdk-preinstalled-amazon-linux-ec2
22
+ ```
23
+
24
+ Use it in your CDK stack:
25
+
26
+ ```python
27
+ import { PreinstalledAmazonLinuxInstance } from 'cdk-preinstalled-amazon-linux-ec2';
28
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
29
+
30
+ declare const vpc: ec2.IVpc;
31
+
32
+ // You can configure all properties of the EC2 instance
33
+ new PreinstalledAmazonLinuxInstance(this, 'Instance', {
34
+ vpc,
35
+ instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.NANO),
36
+ machineImage: new ec2.AmazonLinuxImage({
37
+ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023,
38
+ }),
39
+ // Specify preinstalled software
40
+ preinstalledSoftware: {
41
+ type: [
42
+ PreinstalledSoftwareType.NODEJS,
43
+ PreinstalledSoftwareType.VSCODE,
44
+ PreinstalledSoftwareType.GIT,
45
+ ],
46
+ others: ['rsyslog'], // You can specify other software packages. These parameters are used as `sudo dnf install ${parameter}`
47
+ });
48
+ ```
49
+
50
+ After the stack is deployed, you can SSH into the EC2 instance and use Node.js:
51
+
52
+ ```bash
53
+ $ ssh ec2-user@<public-ip>
54
+ $ node --version
55
+ v20.13.1
56
+ $ code --version
57
+ 1.89.1
58
+ $ git --version
59
+ git version 2.39.3
60
+ ```
61
+
62
+ ## user data
63
+
64
+ Installation of software is done by user data script. You can see the script in the `src/index.ts` file.
65
+
66
+ ```python
67
+ // Install Node.js
68
+ userData.addCommands(
69
+ 'touch ~/.bashrc',
70
+ 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash',
71
+ 'source ~/.bashrc',
72
+ 'export NVM_DIR="$HOME/.nvm"',
73
+ '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"',
74
+ `nvm install ${props.nodeJsVersion ?? '--lts'}`,
75
+ // Note that the above will install nvm, node and npm for the root user.
76
+ // It will not add the correct ENV VAR in ec2-user's environment.
77
+ `cat <<EOF >> /home/ec2-user/.bashrc
78
+ export NVM_DIR="/.nvm"
79
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
80
+ EOF`);
81
+ ```
82
+
83
+ Ofcourse, you can customize the additional user data script by calling `instance.userData.addCommands()` method.
84
+
85
+ ```python
86
+ declare const instance: PreinstalledAmazonLinuxInstance;
87
+
88
+ // install Postgresql
89
+ instance.userData.addCommands(
90
+ 'sudo dnf install -y postgresql15-server'
91
+ );
92
+ ```
@@ -5,7 +5,7 @@ kwargs = json.loads(
5
5
  """
6
6
  {
7
7
  "name": "cdk-preinstalled-amazon-linux-ec2",
8
- "version": "0.0.0",
8
+ "version": "0.0.2",
9
9
  "description": "CDK Construct for creating an Amazon Linux EC2 instance with pre-installed software",
10
10
  "license": "Apache-2.0",
11
11
  "url": "https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git",
@@ -26,7 +26,7 @@ kwargs = json.loads(
26
26
  ],
27
27
  "package_data": {
28
28
  "cdk_preinstalled_amazon_linux_ec2._jsii": [
29
- "cdk-preinstalled-amazon-linux-ec2@0.0.0.jsii.tgz"
29
+ "cdk-preinstalled-amazon-linux-ec2@0.0.2.jsii.tgz"
30
30
  ],
31
31
  "cdk_preinstalled_amazon_linux_ec2": [
32
32
  "py.typed"
@@ -1,5 +1,96 @@
1
1
  '''
2
- # replace this
2
+ # CDK Preinstalled Amazon Linux EC2 Instance Construct
3
+
4
+ This is a CDK Construct for creating a preinstalled AmazonLinux EC2 instance.
5
+
6
+ You can use Node.js, Visual Studio Code, git and other software as soon as the EC2 instance starts.
7
+
8
+ [![View on Construct Hub](https://constructs.dev/badge?package=cdk-preinstalled-amazon-linux-ec2)](https://constructs.dev/packages/cdk-preinstalled-amazon-linux-ec2)
9
+
10
+ [![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc)](https://open.vscode.dev/badmintoncryer/cdk-preinstalled-amazon-linux-ec2)
11
+ [![npm version](https://badge.fury.io/js/cdk-preinstalled-amazon-linux-ec2.svg)](https://badge.fury.io/js/cdk-preinstalled-amazon-linux-ec2)
12
+ [![Build Status](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/build.yml/badge.svg)](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/build.yml)
13
+ [![Release Status](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/release.yml/badge.svg)](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/release.yml)
14
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
15
+ [![npm downloads](https://img.shields.io/npm/dm/cdk-preinstalled-amazon-linux-ec2.svg?style=flat)](https://www.npmjs.com/package/cdk-preinstalled-amazon-linux-ec2)
16
+
17
+ ## Usage
18
+
19
+ Install the package:
20
+
21
+ ```bash
22
+ npm install cdk-preinstalled-amazon-linux-ec2
23
+ ```
24
+
25
+ Use it in your CDK stack:
26
+
27
+ ```python
28
+ import { PreinstalledAmazonLinuxInstance } from 'cdk-preinstalled-amazon-linux-ec2';
29
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
30
+
31
+ declare const vpc: ec2.IVpc;
32
+
33
+ // You can configure all properties of the EC2 instance
34
+ new PreinstalledAmazonLinuxInstance(this, 'Instance', {
35
+ vpc,
36
+ instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.NANO),
37
+ machineImage: new ec2.AmazonLinuxImage({
38
+ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023,
39
+ }),
40
+ // Specify preinstalled software
41
+ preinstalledSoftware: {
42
+ type: [
43
+ PreinstalledSoftwareType.NODEJS,
44
+ PreinstalledSoftwareType.VSCODE,
45
+ PreinstalledSoftwareType.GIT,
46
+ ],
47
+ others: ['rsyslog'], // You can specify other software packages. These parameters are used as `sudo dnf install ${parameter}`
48
+ });
49
+ ```
50
+
51
+ After the stack is deployed, you can SSH into the EC2 instance and use Node.js:
52
+
53
+ ```bash
54
+ $ ssh ec2-user@<public-ip>
55
+ $ node --version
56
+ v20.13.1
57
+ $ code --version
58
+ 1.89.1
59
+ $ git --version
60
+ git version 2.39.3
61
+ ```
62
+
63
+ ## user data
64
+
65
+ Installation of software is done by user data script. You can see the script in the `src/index.ts` file.
66
+
67
+ ```python
68
+ // Install Node.js
69
+ userData.addCommands(
70
+ 'touch ~/.bashrc',
71
+ 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash',
72
+ 'source ~/.bashrc',
73
+ 'export NVM_DIR="$HOME/.nvm"',
74
+ '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"',
75
+ `nvm install ${props.nodeJsVersion ?? '--lts'}`,
76
+ // Note that the above will install nvm, node and npm for the root user.
77
+ // It will not add the correct ENV VAR in ec2-user's environment.
78
+ `cat <<EOF >> /home/ec2-user/.bashrc
79
+ export NVM_DIR="/.nvm"
80
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
81
+ EOF`);
82
+ ```
83
+
84
+ Ofcourse, you can customize the additional user data script by calling `instance.userData.addCommands()` method.
85
+
86
+ ```python
87
+ declare const instance: PreinstalledAmazonLinuxInstance;
88
+
89
+ // install Postgresql
90
+ instance.userData.addCommands(
91
+ 'sudo dnf install -y postgresql15-server'
92
+ );
93
+ ```
3
94
  '''
4
95
  from pkgutil import extend_path
5
96
  __path__ = extend_path(__path__, __name__)
@@ -18,9 +18,9 @@ import constructs._jsii
18
18
 
19
19
  __jsii_assembly__ = jsii.JSIIAssembly.load(
20
20
  "cdk-preinstalled-amazon-linux-ec2",
21
- "0.0.0",
21
+ "0.0.2",
22
22
  __name__[0:-6],
23
- "cdk-preinstalled-amazon-linux-ec2@0.0.0.jsii.tgz",
23
+ "cdk-preinstalled-amazon-linux-ec2@0.0.2.jsii.tgz",
24
24
  )
25
25
 
26
26
  __all__ = [
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.1
2
+ Name: cdk-preinstalled-amazon-linux-ec2
3
+ Version: 0.0.2
4
+ Summary: CDK Construct for creating an Amazon Linux EC2 instance with pre-installed software
5
+ Home-page: https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git
6
+ Author: Kazuho CryerShinozuka<malaysia.cryer@gmail.com>
7
+ License: Apache-2.0
8
+ Project-URL: Source, https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: JavaScript
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Typing :: Typed
18
+ Classifier: Development Status :: 5 - Production/Stable
19
+ Classifier: License :: OSI Approved
20
+ Requires-Python: ~=3.8
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+
24
+ # CDK Preinstalled Amazon Linux EC2 Instance Construct
25
+
26
+ This is a CDK Construct for creating a preinstalled AmazonLinux EC2 instance.
27
+
28
+ You can use Node.js, Visual Studio Code, git and other software as soon as the EC2 instance starts.
29
+
30
+ [![View on Construct Hub](https://constructs.dev/badge?package=cdk-preinstalled-amazon-linux-ec2)](https://constructs.dev/packages/cdk-preinstalled-amazon-linux-ec2)
31
+
32
+ [![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc)](https://open.vscode.dev/badmintoncryer/cdk-preinstalled-amazon-linux-ec2)
33
+ [![npm version](https://badge.fury.io/js/cdk-preinstalled-amazon-linux-ec2.svg)](https://badge.fury.io/js/cdk-preinstalled-amazon-linux-ec2)
34
+ [![Build Status](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/build.yml/badge.svg)](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/build.yml)
35
+ [![Release Status](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/release.yml/badge.svg)](https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2/actions/workflows/release.yml)
36
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
37
+ [![npm downloads](https://img.shields.io/npm/dm/cdk-preinstalled-amazon-linux-ec2.svg?style=flat)](https://www.npmjs.com/package/cdk-preinstalled-amazon-linux-ec2)
38
+
39
+ ## Usage
40
+
41
+ Install the package:
42
+
43
+ ```bash
44
+ npm install cdk-preinstalled-amazon-linux-ec2
45
+ ```
46
+
47
+ Use it in your CDK stack:
48
+
49
+ ```python
50
+ import { PreinstalledAmazonLinuxInstance } from 'cdk-preinstalled-amazon-linux-ec2';
51
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
52
+
53
+ declare const vpc: ec2.IVpc;
54
+
55
+ // You can configure all properties of the EC2 instance
56
+ new PreinstalledAmazonLinuxInstance(this, 'Instance', {
57
+ vpc,
58
+ instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.NANO),
59
+ machineImage: new ec2.AmazonLinuxImage({
60
+ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2023,
61
+ }),
62
+ // Specify preinstalled software
63
+ preinstalledSoftware: {
64
+ type: [
65
+ PreinstalledSoftwareType.NODEJS,
66
+ PreinstalledSoftwareType.VSCODE,
67
+ PreinstalledSoftwareType.GIT,
68
+ ],
69
+ others: ['rsyslog'], // You can specify other software packages. These parameters are used as `sudo dnf install ${parameter}`
70
+ });
71
+ ```
72
+
73
+ After the stack is deployed, you can SSH into the EC2 instance and use Node.js:
74
+
75
+ ```bash
76
+ $ ssh ec2-user@<public-ip>
77
+ $ node --version
78
+ v20.13.1
79
+ $ code --version
80
+ 1.89.1
81
+ $ git --version
82
+ git version 2.39.3
83
+ ```
84
+
85
+ ## user data
86
+
87
+ Installation of software is done by user data script. You can see the script in the `src/index.ts` file.
88
+
89
+ ```python
90
+ // Install Node.js
91
+ userData.addCommands(
92
+ 'touch ~/.bashrc',
93
+ 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash',
94
+ 'source ~/.bashrc',
95
+ 'export NVM_DIR="$HOME/.nvm"',
96
+ '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"',
97
+ `nvm install ${props.nodeJsVersion ?? '--lts'}`,
98
+ // Note that the above will install nvm, node and npm for the root user.
99
+ // It will not add the correct ENV VAR in ec2-user's environment.
100
+ `cat <<EOF >> /home/ec2-user/.bashrc
101
+ export NVM_DIR="/.nvm"
102
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
103
+ EOF`);
104
+ ```
105
+
106
+ Ofcourse, you can customize the additional user data script by calling `instance.userData.addCommands()` method.
107
+
108
+ ```python
109
+ declare const instance: PreinstalledAmazonLinuxInstance;
110
+
111
+ // install Postgresql
112
+ instance.userData.addCommands(
113
+ 'sudo dnf install -y postgresql15-server'
114
+ );
115
+ ```
@@ -11,4 +11,4 @@ src/cdk_preinstalled_amazon_linux_ec2.egg-info/dependency_links.txt
11
11
  src/cdk_preinstalled_amazon_linux_ec2.egg-info/requires.txt
12
12
  src/cdk_preinstalled_amazon_linux_ec2.egg-info/top_level.txt
13
13
  src/cdk_preinstalled_amazon_linux_ec2/_jsii/__init__.py
14
- src/cdk_preinstalled_amazon_linux_ec2/_jsii/cdk-preinstalled-amazon-linux-ec2@0.0.0.jsii.tgz
14
+ src/cdk_preinstalled_amazon_linux_ec2/_jsii/cdk-preinstalled-amazon-linux-ec2@0.0.2.jsii.tgz
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: cdk-preinstalled-amazon-linux-ec2
3
- Version: 0.0.0
4
- Summary: CDK Construct for creating an Amazon Linux EC2 instance with pre-installed software
5
- Home-page: https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git
6
- Author: Kazuho CryerShinozuka<malaysia.cryer@gmail.com>
7
- License: Apache-2.0
8
- Project-URL: Source, https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: JavaScript
12
- Classifier: Programming Language :: Python :: 3 :: Only
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Typing :: Typed
18
- Classifier: Development Status :: 5 - Production/Stable
19
- Classifier: License :: OSI Approved
20
- Requires-Python: ~=3.8
21
- Description-Content-Type: text/markdown
22
- License-File: LICENSE
23
-
24
- # replace this
@@ -1 +0,0 @@
1
- # replace this
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: cdk-preinstalled-amazon-linux-ec2
3
- Version: 0.0.0
4
- Summary: CDK Construct for creating an Amazon Linux EC2 instance with pre-installed software
5
- Home-page: https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git
6
- Author: Kazuho CryerShinozuka<malaysia.cryer@gmail.com>
7
- License: Apache-2.0
8
- Project-URL: Source, https://github.com/badmintoncryer/cdk-preinstalled-amazon-linux-ec2.git
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: JavaScript
12
- Classifier: Programming Language :: Python :: 3 :: Only
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Typing :: Typed
18
- Classifier: Development Status :: 5 - Production/Stable
19
- Classifier: License :: OSI Approved
20
- Requires-Python: ~=3.8
21
- Description-Content-Type: text/markdown
22
- License-File: LICENSE
23
-
24
- # replace this