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

Story: Infrastructure Customizations #493

Closed
Tracked by #658
eladb opened this issue Nov 8, 2022 · 4 comments · Fixed by #1218
Closed
Tracked by #658

Story: Infrastructure Customizations #493

eladb opened this issue Nov 8, 2022 · 4 comments · Fixed by #1218
Assignees
Labels
✨ enhancement New feature or request

Comments

@eladb
Copy link
Contributor

eladb commented Nov 8, 2022

Summary

Apply non-functional infrastructure concerns on Wing apps using declarative, policy-driven syntax.

Feature Spec

(hypothetical readme)

You can use wing policy files to apply infrastructure policies to your wing applications during compilation.

Use the --policy switch in the compiler to tell the compiler which policy to use. For example:

$ wing compile hello.w --target tf-aws --policy my-policy.wp

Where my-policy.wp is (this is just a mock up):

resource aws_s3_bucket * {
  ...

  versioning {
    enabled = true
  }
}

The policy file is a bit like a CSS file. It selects which elements in the Terraform output to work on and then applies a bunch of attributes on it. This rule selects all aws_s3_bucket resources (hence the *) and enables versioning on the bucket.

Use Cases

  • Deploy this to AWS and make all the buckets encrypted
  • Put all the resources in side the VPC
  • I want this app to be HIPPA-compliant
  • Set the property "foo_bar" of resource "s3_bucket.bufol.dkkdjf" to "false"
  • Tag all the resources with this label
  • Don't allow any IAM policy to perform s3:putObject operations.
@eladb eladb added ✨ enhancement New feature or request need-triage labels Nov 8, 2022
@staycoolcall911 staycoolcall911 moved this to 🆕 New - not properly defined in Wing Nov 20, 2022
@eladb
Copy link
Contributor Author

eladb commented Dec 14, 2022

See discussion #868 started by @schosterbarak about "hosting" Wing apps within existing "environments".

Example use case: I have a VPC that is already defined elsewhere (be it through IAC or manually), and I want all my Wing resources to be deployed into this VPC. That's a classic non-functional aspect of the deployment that we want to support.

@eladb eladb changed the title Epic: Infrastructure as policy Epic: Infrastructure policy Jan 9, 2023
@eladb eladb changed the title Epic: Infrastructure policy Story: Infrastructure policy Jan 9, 2023
@darrenweiner
Copy link

Could be useful to have a set of pre-defined policies that track with well-architected principles, but with different levels of resiliency or security: Thinking of something like "well-architected t-shirt sizing":
Maybe the small version is intended for dev environments:

Even small would have key best practices around least access/privledge, but when it comes to other areas that have cost implications, it's 'lighter' on the configs:
Examples:
single AZ deployments
Minimal backup policies (e.g. 1 day)
Minimal resiliency in general (Autoscaling with minimum of 1, that sort of thing)
AWS-managed encryption

medium - for production-style workloads
Multi-AZ
backup policies of 30 days
Autoscaling minimum of 2
CMK managed encryption
etc etc

large - for Enterprise/X-Region needs
Multi-region data resiliency and deployments (e.g. S3 replication X-region, RDS X-Region if available, etc)
other things I haven't thought of at the moment.

@hasanaburayyan
Copy link
Contributor

hasanaburayyan commented Jan 16, 2023

Once this is implemented we will need to update the temporary solution in #1162 (azure location) using env variable to retrieve location app prop for Azure

@eladb eladb assigned hasanaburayyan and unassigned eladb Jan 24, 2023
@eladb eladb changed the title Story: Infrastructure policy Story: Infrastructure Customizations Jan 25, 2023
@staycoolcall911 staycoolcall911 moved this from 🆕 New - not properly defined to 🤝 Backlog - handoff to owners in Wing Jan 30, 2023
@staycoolcall911 staycoolcall911 moved this from 🤝 Backlog - handoff to owners to 🏗 In progress in Wing Jan 30, 2023
@staycoolcall911 staycoolcall911 moved this from 🏗 In progress to 👀 In review in Wing Feb 2, 2023
@mergify mergify bot closed this as completed in #1218 Feb 7, 2023
mergify bot pushed a commit that referenced this issue Feb 7, 2023
Just initial thoughts so far.

The goal: provide a plugin system that allows users wing to provide non-functional requirements to their wing applications.

[Rendered Version](https://github.com/winglang/wing/blob/hasanaburayyan/wing-plugin-system/docs/05-rfcs/2023-01-21-wing-plugins.md)

Resolves #493

*By submitting this pull request, I confirm that my contribution is made under the terms of the 
[Monada Contribution License](https://docs.winglang.io/terms-and-policies/contribution-license.html)*.
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Wing Feb 7, 2023
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.5.8.

skyrpex pushed a commit that referenced this issue Jun 21, 2023
Upgrades project dependencies. See details in [workflow run].

[Workflow Run]:
https://github.com/winglang/console/actions/runs/4882222919

------

*Automatically created via the "upgrade" workflow.*

Signed-off-by: monadabot <monabot@monada.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants