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

[Resolve #1114,#886,#491] Project Dependencies part 2: Resolvable role_arn and template_bucket_name #1153

Merged
merged 44 commits into from
Dec 27, 2021

Conversation

jfalkenstein
Copy link
Contributor

@jfalkenstein jfalkenstein commented Nov 7, 2021

This is the second in a series of pull requests that addresses #1114 , allowing Sceptre to manage its own dependencies.

In this PR:

  • The ResolvableValueProperty is created, creating a property that can resolve to a single value (not a list or dict)
  • role_arn and template_bucket_name are now fully resolvable properties
  • If template_bucket_name is set to None on a stack, it will be interpreted as if it wasn't there at all. This will be important in future Pull Requests so that if template_bucket_name is inherited from the stack_group, it won't actually create a circular dependency on the stack that outputs that bucket name.
  • Documentation is clarified on setting stack dependencies on a StackGroup to be shared across all stacks in that group as well as a warning about circular dependencies.

PR Checklist

  • Wrote a good commit message & description [see guide below].
  • Commit message starts with [Resolve #issue-number].
  • Added/Updated unit tests.
  • Added/Updated integration tests (if applicable).
  • All unit tests (make test) are passing.
  • Used the same coding conventions as the rest of the project.
  • The new code passes pre-commit validations (pre-commit run --all-files).
  • The PR relates to only one subject with a clear title.
    and description in grammatically correct, complete sentences.

Approver/Reviewer Checklist

  • Before merge squash related commits.

Other Information

Guide to writing a good commit

@jfalkenstein jfalkenstein self-assigned this Nov 7, 2021
@jfalkenstein jfalkenstein changed the title Jf/proj dependencies p2 resolvable value property [Resolve #1114,#886] Project Dependencies part 1: ResolvableValueProperty + resolvable role_arn, template_bucket_name, and template_key_prefix Nov 7, 2021
@jfalkenstein jfalkenstein changed the title [Resolve #1114,#886] Project Dependencies part 1: ResolvableValueProperty + resolvable role_arn, template_bucket_name, and template_key_prefix [Resolve #1114,#886] Project Dependencies part 2: ResolvableValueProperty + resolvable role_arn, template_bucket_name, and template_key_prefix Nov 7, 2021
@jfalkenstein jfalkenstein changed the title [Resolve #1114,#886] Project Dependencies part 2: ResolvableValueProperty + resolvable role_arn, template_bucket_name, and template_key_prefix [Resolve #1114,#886,#491] Project Dependencies part 2: ResolvableValueProperty + resolvable role_arn, template_bucket_name, and template_key_prefix Nov 7, 2021
@jfalkenstein jfalkenstein changed the title [Resolve #1114,#886,#491] Project Dependencies part 2: ResolvableValueProperty + resolvable role_arn, template_bucket_name, and template_key_prefix [Resolve #1114,#886,#491] Project Dependencies part 2: Resolvable role_arn, template_bucket_name, and template_key_prefix Nov 7, 2021
@jfalkenstein jfalkenstein marked this pull request as ready for review November 11, 2021 21:27
@jfalkenstein jfalkenstein changed the base branch from feature/project-dependencies to jf/proj-dependencies-p1-property-refactor December 11, 2021 15:39
@jfalkenstein jfalkenstein changed the title [Resolve #1114,#886,#491] Project Dependencies part 2: Resolvable role_arn, template_bucket_name, and template_key_prefix [Resolve #1114,#886,#491] Project Dependencies part 2: Resolvable role_arn and template_bucket_name Dec 11, 2021
@jfalkenstein jfalkenstein requested a review from zxiiro December 11, 2021 17:08
@jfalkenstein
Copy link
Contributor Author

Alright @zaro0508 , @zxiiro this PR is now fully ready for review. You both had made some comments on this PR previously (and I've responded to those). I've added in proper docs and integration tests on this PR, so it should now be ready for review.

This PR can be merged and deployed to master without requiring any changes from parts 3 and onward. However, this PR is pointed at the Part 1 branch because it builds on the changes in that one.

Comment on lines 71 to 74
If you resolve ``template_bucket_name`` using the ``!stack_output``
resolver on a StackGroup, the stack that outputs that bucket name *cannot* be
defined in that StackGroup. Otherwise, a circular dependency will exist and Sceptre
will raise an error when attempting any Stack action.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice description of how it should not be done. Is it possible to provide an example of a property way to do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I can add another line indicating the correct way to do it.

Comment on lines 193 to 196
You might have already considered that this might cause a circular dependency for those
dependency stacks, the ones that output the template bucket name, role arn, iam_role, or topic arns.
In order to avoid the circular dependency issue, it is important that you define these items in a
Stack that is *outside* the StackGroup you reference them in.
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above. an example directory structure and files would really help.

@jfalkenstein
Copy link
Contributor Author

@zaro0508 , I gave two examples of project structure supporting referencing project dependencies with !stack_output.

Base automatically changed from jf/proj-dependencies-p1-property-refactor to master December 27, 2021 15:00
@jfalkenstein jfalkenstein merged commit d18cf70 into master Dec 27, 2021
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.

3 participants