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

Environment Specific Patches? #5747

Open
ssyberg opened this issue Mar 28, 2024 · 4 comments
Open

Environment Specific Patches? #5747

ssyberg opened this issue Mar 28, 2024 · 4 comments
Labels
guidance Issue requesting guidance or information about usage stale

Comments

@ssyberg
Copy link

ssyberg commented Mar 28, 2024

Not sure if this is a feature request or just a question, but I'm trying to figure out how to implement different patches per environment or at least set parameters/variables per environment?

For example, if I have a staging and production environment how can I add this patch such that it doesn't get added to both load balancers or at least has slightly different values for each environment?

- op: add
  path: /Resources/HTTPSListenerRuleRedirect
  value:
    Metadata:
        'aws:copilot:description': 'An HTTPS listener redirect rule'
    Type: AWS::ElasticLoadBalancingV2::ListenerRule
    Properties:
      Actions:
        - Type: redirect
          RedirectConfig:
            Protocol: HTTPS
            Port: '443'
            Host: 'production.com'
            Path: '/foo'
            Query: '#{query}'
            StatusCode: HTTP_301
      Conditions:
        - Field: host-header
          HostHeaderConfig:
            Values:
              - production.org
        - Field: path-pattern
          PathPatternConfig:
            Values:
              - /
      Priority: 40000
      ListenerArn: !GetAtt EnvControllerAction.HTTPSListenerArn
@dannyrandall
Copy link
Contributor

Hey @ssyberg! You could try using Conditions like in this example for addons: #4229. You can use patches to create conditions for each environment, and then add that Condition to the resources you want to conditionally create for each specific environment.

@dannyrandall dannyrandall added the guidance Issue requesting guidance or information about usage label Mar 29, 2024
@ssyberg
Copy link
Author

ssyberg commented Apr 1, 2024

Hey @ssyberg! You could try using Conditions like in this example for addons: #4229. You can use patches to create conditions for each environment, and then add that Condition to the resources you want to conditionally create for each specific environment.

Ooh yes that seems like it could work, ty!

Copy link

github-actions bot commented Jun 1, 2024

This issue is stale because it has been open 60 days with no response activity. Remove the stale label, add a comment, or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Issue requesting guidance or information about usage stale
Projects
None yet
Development

No branches or pull requests

2 participants