-
Notifications
You must be signed in to change notification settings - Fork 38
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
[BACKWARDS INCOMPATIBLE] S3 env var #250
Conversation
@@ -97,7 +99,7 @@ func (r *AwsRuntime) TransformPersist(file *core.SourceFile, annot *core.Annotat | |||
importModule := "" | |||
switch kind { | |||
case core.PersistFileKind: | |||
importModule = "fs" | |||
importModule = "fs_" + annot.Capability.ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be sanitized? I forget what (if any) restrictions we enforce on ids.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this is just for the import itself in the file. I cut a card so that we actually just pass the bucket name to the open call, but that requires a lot of extra work, so for now we are just importing an fs runtime per bucket and thats why we need different import modules
} | ||
|
||
fsEnvVar := core.EnvironmentVariable{ | ||
Name: cap.Capability.ID + "_bucket_name", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto on sanitization here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name is just the env var name, so it doesnt go through sanitization. The actual bucket name will be the value and that is dynamically generated based on the sanitized bucket name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do annotation ids have any restriction, do you know offhand? For example, can they contain spaces? (afaik, an env var can't.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah the annotation ids are the same regex as the app name, so i believe that it should be valid env vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot to change the radio box to "Approve" when I submitted the previous review. Neither of my comments is blocking.
|
• Does any part of it require special attention?
• Does it relate to or fix any issue? closes #227 and closes https://github.com/klothoplatform/klotho-pro/issues/51
Changes our logic so that we create a bucket per ID with an FS annotation. We also create a new InternalResource concept so that we can track the resource we use for proxy/dispatcher (payloads bucket)
We use env vars to inject the bucket names into the fs runtime and we have a file per bucket at the moment. Opened #249 as an enhancement so we can limit the number of runtime files in the future.
We also can fully do sanitization at the IAC layer and now our payloads bucket will have the wording InternalKlothoPayloads.
opened klotho #247 because we cant fully remove the payloads bucket from template config until we take out the hardcoding from pubsub
Standard checks
Further testing https://github.com/klothoplatform/klotho/actions/runs/4198937619