-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(aws-s3-deployment): Support include and exclude options for S3 sync #14362
Comments
I'm not sure I follow. Are you looking for the Can you share a code snippet of how your use-case would be supported? |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I'll get a sample up for this early next week. |
In this case, it is common to generate config from the CDK that needs to be read at runtime by a web application (items that aren't yet known at synth time). With this being the case, I generally (and I have seen others do this as well) generate a file that is read at runtime (for the purposes of this example, I will call this This can be accomplished with the AWS CLI by using either the # build webapp
npm run build
# deploy webapp
aws s3 sync . s3://cdk-s3sync-test/
# generate config file (by whatever process)
# upload config file
aws s3 cp config.js s3://cdk-s3sync-test/
# redeploy webapp on change (doesn't delete config.js)
aws s3 sync . s3://cdk-s3sync-test/ --delete --exclude config.js In terms of the CDK, I would like to see this work in the following manner: new s3Deploy.BucketDeployment(this, 'WebAppDeploy', {
// bundling options....
prune: true,
exclude: 'config.js'
}); Include could also be used for a similar effect. Since both options are supported in the AWS CLI, these could be added into the current process with minimal rework. |
@davidtucker Thanks for the explanation, I understand what you mean now. I am unassigning and marking this issue as We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization. |
This construct only enables integration with the two existing CLI options (`--exclude` and `--include`) that are supported for the `s3 sync` command. There are a few situations where this can prove valuable: 1. Situations where you want to deploy a subset of files from an archive - This can be handled by leveraging the bundling option for a source, although in some situations the `exclude` filter would be significantly easier. 2. Situations where you want to leverage `prune` but have specific files excluded - This is the situation that cannot be solved with current tools. The most common scenario (and one I detailed in #14362 ) is where you manage a web app config file with a custom CloudFormation resource (to pass in API endpoint, user pool, etc...) and then manage a web application using this construct. Closes #14362 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
This construct only enables integration with the two existing CLI options (`--exclude` and `--include`) that are supported for the `s3 sync` command. There are a few situations where this can prove valuable: 1. Situations where you want to deploy a subset of files from an archive - This can be handled by leveraging the bundling option for a source, although in some situations the `exclude` filter would be significantly easier. 2. Situations where you want to leverage `prune` but have specific files excluded - This is the situation that cannot be solved with current tools. The most common scenario (and one I detailed in aws#14362 ) is where you manage a web app config file with a custom CloudFormation resource (to pass in API endpoint, user pool, etc...) and then manage a web application using this construct. Closes aws#14362 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This construct only enables integration with the two existing CLI options (`--exclude` and `--include`) that are supported for the `s3 sync` command. There are a few situations where this can prove valuable: 1. Situations where you want to deploy a subset of files from an archive - This can be handled by leveraging the bundling option for a source, although in some situations the `exclude` filter would be significantly easier. 2. Situations where you want to leverage `prune` but have specific files excluded - This is the situation that cannot be solved with current tools. The most common scenario (and one I detailed in aws#14362 ) is where you manage a web app config file with a custom CloudFormation resource (to pass in API endpoint, user pool, etc...) and then manage a web application using this construct. Closes aws#14362 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This construct only enables integration with the two existing CLI options (`--exclude` and `--include`) that are supported for the `s3 sync` command. There are a few situations where this can prove valuable: 1. Situations where you want to deploy a subset of files from an archive - This can be handled by leveraging the bundling option for a source, although in some situations the `exclude` filter would be significantly easier. 2. Situations where you want to leverage `prune` but have specific files excluded - This is the situation that cannot be solved with current tools. The most common scenario (and one I detailed in aws#14362 ) is where you manage a web app config file with a custom CloudFormation resource (to pass in API endpoint, user pool, etc...) and then manage a web application using this construct. Closes aws#14362 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This construct only enables integration with the two existing CLI options (`--exclude` and `--include`) that are supported for the `s3 sync` command. There are a few situations where this can prove valuable: 1. Situations where you want to deploy a subset of files from an archive - This can be handled by leveraging the bundling option for a source, although in some situations the `exclude` filter would be significantly easier. 2. Situations where you want to leverage `prune` but have specific files excluded - This is the situation that cannot be solved with current tools. The most common scenario (and one I detailed in aws#14362 ) is where you manage a web app config file with a custom CloudFormation resource (to pass in API endpoint, user pool, etc...) and then manage a web application using this construct. Closes aws#14362 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The
aws-s3-deployment
module currently does not support theinclude
andexclude
options that are available in the S3 sync command. By adding this, additional use cases can be supported.Use Case
In my case, I have a single-page web app that uses a config file that is generated by a CloudFormation custom resource. I would like to leverage aws-s3-deployment for the deployment of the web application, but I want to ensure that the config file is not deleted when
prune
is set to true (although I do want all of the other files to be deleted).Proposed Solution
By supporting the include and exclude properties for the S3 sync command with the aws-s3-deployment Lambda function, you can support this use case.
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: