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

(codedeploy.ServerDeploymentGroup): Creating ServerDeploymentGroup does not create Application implicitly #13337

Closed
dhirajkhodade opened this issue Mar 2, 2021 · 4 comments · Fixed by #13582
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@dhirajkhodade
Copy link

❓ General Issue

I tried to create ServerDeploymentGroup and ran into this error -

Error: Resolution error: Resolution error: Resolution error: Resolution error: Cannot use resource 'DeploymentGroupStack/my-app/Application' in a cross-environment fashion, the resource's physical name must be explicit set or use PhysicalName.GENERATE_IF_NEEDED.

Code -

new codedeploy.ServerDeploymentGroup(this, props.applicationName, {
         deploymentGroupName: PhysicalName.GENERATE_IF_NEEDED,
         ec2InstanceTags: new codedeploy.InstanceTagSet({
        'Name': [props.applicationName],
      }),
    })

To resolve this error I had to create Application first

const application = new codedeploy.ServerApplication(this, 'App', {
      applicationName: PhysicalName.GENERATE_IF_NEEDED,
    });

new codedeploy.ServerDeploymentGroup(this, props.applicationName, {
      deploymentGroupName: PhysicalName.GENERATE_IF_NEEDED,
      application: application,
      ec2InstanceTags: new codedeploy.InstanceTagSet({
        'Name': [props.applicationName],
      }),
    });

Expected Result

I think doing this should automatically create the Application owning the Deployment Group also with PhysicalName.GENERATE_IF_NEEDED.

    new codedeploy.ServerDeploymentGroup(this, props.applicationName, {
      deploymentGroupName: PhysicalName.GENERATE_IF_NEEDED,
    });

Refer - Discussion

Environment

  • CDK CLI Version: 1.89.0
  • Module Version: 1.89.0
  • Node.js Version: 12.16.1
  • OS: Windows 10
  • Language (Version): Typescript

Other information

@dhirajkhodade dhirajkhodade added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Mar 2, 2021
@github-actions github-actions bot added the @aws-cdk/aws-codedeploy Related to AWS CodeDeploy label Mar 2, 2021
@skinny85 skinny85 added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 good first issue Related to contributions. See CONTRIBUTING.md and removed guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Mar 2, 2021
@skinny85 skinny85 removed their assignment Mar 2, 2021
@BLasan
Copy link
Contributor

BLasan commented Mar 6, 2021

/assign

@BLasan
Copy link
Contributor

BLasan commented Mar 6, 2021

@skinny85 Can I work on this?

@skinny85
Copy link
Contributor

skinny85 commented Mar 8, 2021

Absolutely @BLasan! Thanks for your willingness to contribute to the CDK 😊.

BLasan added a commit to BLasan/aws-cdk that referenced this issue Mar 14, 2021
BLasan added a commit to BLasan/aws-cdk that referenced this issue Mar 14, 2021
BLasan added a commit to BLasan/aws-cdk that referenced this issue Mar 14, 2021
@mergify mergify bot closed this as completed in #13582 Mar 22, 2021
mergify bot pushed a commit that referenced this issue Mar 22, 2021
…pplication (#13582)

fixes #13337


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

eladb pushed a commit that referenced this issue Mar 24, 2021
…pplication (#13582)

fixes #13337


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Aug 26, 2021
…pplication (aws#13582)

fixes aws#13337


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants