How t0maser/ec2-instancia-pruebatecnicairis works
Main Components
• CDK Application Entry Point: Use the file in the bin folder (bin/ec2-instancia.ts) as the starting point. This is where the CDK app gets instantiated.
• Infrastructure Stack: The main stack defined in lib/ec2-instancia-stack.ts includes the definitions for the AWS resources—in this case, the EC2 instance. It is here that configurations like the SSH key (pre-configured via AWS CLI) and the local IP (set by the developer) are applied.
• AWS Resources: Visually represent the target resource (an EC2 Instance) and any associated AWS constructs (potentially a security group and network settings that might be implicit in the stack definition).
• Testing and Configuration Setup: Include areas for your test files (test/ec2-instancia.test.ts) and configuration files (cdk.json, package.json, jest.config.js, tsconfig.json) to indicate that there is a full development lifecycle with build, test, and deploy actions.
Relationships and Interactions
• That the Infrastructure Stack results in provisioning an EC2 instance on AWS. Represent this AWS EC2 resource in a separate “Cloud” boundary.
• A side note that indicates testing takes place (from the test folder) to ensure that components are working as expected before deployment.
Architectural Patterns and Design Principles
• Separation of concerns where the entry point (bin) is responsible solely for bootstrapping, while the stack (lib) handles the cloud resource definitions.
• “infrastructure as code” principle with AWS CDK, making it clear that changes in configuration (like updating the IP) directly affect the deployed infrastructure.
Relevant Technologies, Frameworks, and Libraries
• AWS CDK: The primary framework for defining cloud infrastructure.
• TypeScript: Evident from the .ts file extensions and tsconfig.json.
• AWS CLI: Plays a role in deployment and resource configuration.
• Node.js: As the runtime for executing the CDK application.
• Testing Framework: Jest is used for testing (referenced by jest.config.js and files in the test folder).
Elements
• Every major file and folder grouping that matters (bin, lib, test, configuration files) should be represented.
• A cloud boundary that shows the resulting AWS environment and specifically the EC2 instance.
• Annotations that mention dependencies: Node.js, AWS CLI, AWS CDK, and Jest.
• The local development code located in the bin, lib, and test directories.
• The CDK app’s bootstrapping role via bin/ec2-instancia.ts.
• The stack responsible for EC2 instance provisioning as defined in lib/ec2-instancia-stack.ts.
• The deployment process that moves from local testing & build to AWS cloud provisioning.
This comprehensive approach will provide a clear, detailed architectural blueprint tailored to this AWS CDK-driven EC2 instance project.