Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#274] Add project name to the IAM group names #275

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

Nihisil
Copy link
Contributor

@Nihisil Nihisil commented Jan 8, 2024

What happened 👀

  • Add project name to the IAM group name to make sure that it doesn't conflict with other deployed projects
  • Convert project name to lowercase and replace whitespaces with - to make sure that we can use project name as variable

Proof Of Work 📹

Before the fix, I couldn't deploy the template to the company's AWS account since the groups had already been created by the Nexus project:
image

After the fix groups were created:
image

@Nihisil Nihisil added the type : feature New feature or request label Jan 8, 2024
@Nihisil Nihisil added this to the 2.4.0 milestone Jan 8, 2024
@Nihisil Nihisil self-assigned this Jan 8, 2024
Copy link
Member

@malparty malparty left a comment

Choose a reason for hiding this comment

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

Nice 👍

It is maybe not needed, but should add a test for args.projectName.toLowerCase().replace(/\s/g, '-'); (e.g. add a space in the current projectDir = 'core test' and add 1 assertion that the file does main.tf does NOT contains core test but contains core-test. 🤔

Copy link
Contributor

@nvminhtue nvminhtue left a comment

Choose a reason for hiding this comment

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

Besides Xavier's comment about adding covered tests, the rest is LGTM 👍

@Nihisil
Copy link
Contributor Author

Nihisil commented Jan 12, 2024

It is maybe not needed, but should add a test for args.projectName.toLowerCase().replace(/\s/g, '-'); (e.g. add a space in the current projectDir = 'core test' and add 1 assertion that the file does main.tf does NOT contains core test but contains core-test. 🤔

Good point. I have added positive test here: 007ce2a

In cases where the file doesn't contain the value, we don't yet have a helper, and adding one here might be excessive. What do you think?

@Nihisil
Copy link
Contributor Author

Nihisil commented Jan 12, 2024

Also I wasn't clear earlier. After these changes, the directory name for the template output will change too. If a user chooses My dir for their generated templates, it'll be saved to my-dir.

We could split the current project name variable into two: project name and project dir. This would keep the requested directory unchanged, and the generated project name would meet AWS requirements, which often don't allow spaces in names.

However, I don't believe it's worth the effort. In most cases, people don't use directory names with spaces since it's not the norm for developers

@Nihisil Nihisil force-pushed the feature/gh-274-add-name-to-iam-groups branch from 007ce2a to 32b091e Compare February 5, 2024 06:14
@Nihisil Nihisil requested a review from sanG-github as a code owner February 5, 2024 06:14
@Nihisil Nihisil merged commit 578b971 into develop Feb 5, 2024
3 checks passed
@Nihisil Nihisil deleted the feature/gh-274-add-name-to-iam-groups branch February 5, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type : feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add project name to the IAM group names
4 participants