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

Introduce pulumiResourceNamePrefix Parameter #2858

Merged
merged 3 commits into from
Dec 14, 2022
Merged

Conversation

adrians5j
Copy link
Member

@adrians5j adrians5j commented Dec 14, 2022

Changes

In order to prefix all cloud infrastructure (Pulumi) resource names, users had to use the following piece of code in their webiny.application.ts files:

import { createWebsiteApp } from "@webiny/serverless-cms-aws";

export default createWebsiteApp({
    pulumi: app => {
        app.onResource(resource => {
            if (!resource.name.startsWith("wby-")) {
                resource.name = `wby-${resource.name}`;
            }
        });
    }
});

This PR makes this a bit nicer, by introducing the pulumiResourceNamePrefix parameter. With it, prefixing all resources now looks like the following:

import { createWebsiteApp } from "@webiny/serverless-cms-aws";

export default createWebsiteApp({
    pulumiResourceNamePrefix: "wby-"
});

Why is this important? It's because of the #2856 and the fact that the new CWP CloudFormation template now expects the wby- prefix in deployed resource names. Which means, all new Webiny projects will now be deployed with the wby- prefix applied OOTB, via the generated webiny.application.ts files (we've updated the @webiny/cwp-template-aws package).

How Has This Been Tested?

Manually.

Documentation

Updated package README and will add this to the changelog.

@adrians5j adrians5j self-assigned this Dec 14, 2022
@adrians5j adrians5j requested review from Pavel910 and removed request for Pavel910 December 14, 2022 16:56
@adrians5j adrians5j marked this pull request as ready for review December 14, 2022 19:13
@adrians5j adrians5j changed the title Introduce prefixPulumiResources Parameter Introduce pulumiResourceNamePrefix Parameter Dec 14, 2022
@adrians5j adrians5j merged commit 9bd346b into dev Dec 14, 2022
@adrians5j adrians5j deleted the prefix-pulumi-resources branch January 12, 2023 16:53
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.

None yet

2 participants