We've recently added support for downloading specific packages from a given repository using Cloudsmith's Terraform Provider.
The cloudsmith_package
data source allows you to list details and download a specific package from a given repository.
Example Usage
provider "cloudsmith" {
api_key = "my-api-key"
}
resource "cloudsmith_repository" "test" {
name = "terraform-acc-test-package"
namespace = "<your-namespace>"
}
data "cloudsmith_package_list" "test" {
repository = cloudsmith_repository.test.name
namespace = cloudsmith_repository.test.namespace
filters = [
"name:dummy-package",
"version:1.0.48",
]
}
data "cloudsmith_package" "test" {
repository = cloudsmith_repository.test.name
namespace = cloudsmith_repository.test.namespace
identifier = data.cloudsmith_package_list.test.packages[0].slug_perm
download = true
download_dir = "/path/to/your/directory"
}
Customers can use this new functionality to better manage resource execution in Terraform, such as deploying an AWS Lambda with the package source being pulled directly from a Cloudsmith repository.
This release builds on our February update to the Terraform Provider that made it easier than ever to automate provisioning and updating Cloudsmith resources via Terraform. For more on what's new with the Cloudsmith Terraform Provider, please see the previous release notes.
Read the Docs: Cloudsmith Terraform Provider