Skip to content

Provision EC2 instance using cdk#7

Open
Shazil2154 wants to merge 9 commits intomainfrom
feat/cdk-ec2
Open

Provision EC2 instance using cdk#7
Shazil2154 wants to merge 9 commits intomainfrom
feat/cdk-ec2

Conversation

@Shazil2154
Copy link
Member

No description provided.

@Shazil2154 Shazil2154 linked an issue May 30, 2023 that may be closed by this pull request
Base automatically changed from feat/adding-nx to main June 1, 2023 11:43
iamusmanazeem
iamusmanazeem previously approved these changes Jun 6, 2023
test('SQS Queue Created', () => {
// const app = new cdk.App();
// // WHEN
// const stack = new Cdk.CdkStack(app, 'MyTestStack');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamusmanazeem can you write test cases for our current stack

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't stress this enough that we really need to follow the practice of TDD


securityGroup.addIngressRule(
ec2.Peer.anyIpv4(),
ec2.Port.tcp(80),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would encapsulate this entire logic in a separate class you can name it EC2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And tests is a must have


// cdk lets us output prperties of the resources we create after they are created
// we want the ip address of this new instance so we can ssh into it later
// new cdk.CfnOutput(this, 'simple-instance-1-output', {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe we no longer need this comment

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we might need this syntax in the future. we can remove it now

package.json Outdated
"start:dev": "nx start:dev api",
"test": "nx run-many --target=test --all"
"test": "nx run-many --target=test --all",
"start:deploy": "nx run-many --target=deploy --all"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just add deploy. start:deploy doesn't make sense

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

pnpm-lock.yaml Outdated
@@ -1,8 +1,4 @@
lockfileVersion: '6.1'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Shazil2154 add this line in .gitignore
pnpm-lock.yaml
**/pnpm-lock.yaml
then delete this pnpm-lock.yaml file and push

Copy link
Member Author

@Shazil2154 Shazil2154 Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we all are using different versions of pnpm this will cause issues. That is my bad but let's fix it in this pr

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part is already handled in this pr #13

"watch": "tsc -w",
"test": "jest",
"cdk": "cdk",
"deploy":"cdk deploy --profile roadoxe"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was adding a profile in the command a good idea? Because we might name our profiles differently

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess yeah it should be just cdk deploy

@Shazil2154 Shazil2154 marked this pull request as ready for review June 6, 2023 07:09
@Shazil2154
Copy link
Member Author

@iamusmanazeem this pr was a draft if you need a review on a pr or want to merge it. It needs to be open

@Shazil2154
Copy link
Member Author

The changes should've been merged in the first merge commit why do we have to add the commits twice? Each different part should be an isolated commit. I don't see a commit of you pushing the CDK code which means you batched it with the merge commit which is not a good approach. We really need to pick up best practices we are just wasting our time with this project. If we are gonna do the same things we have done up until now what's the point of working on this project?
image

Ismail-butt
Ismail-butt previously approved these changes Jun 6, 2023
@iamusmanazeem iamusmanazeem dismissed stale reviews from Ismail-butt and themself via e90ca53 June 12, 2023 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provision EC2 in our infra

3 participants