atlassian / terraform-provider-artifactory

Terraform provider to manage Artifactory
Apache License 2.0
89 stars 42 forks source link

Add support to download files and their metadata #63

Open volkc-basf opened 4 years ago

volkc-basf commented 4 years ago

Community Note

Description

It would be very helpful to be able to download certain artifacts and/or their metadata using terraform. That way we could simply store all of our lambda deployment packages in artifactory.

New or Affected Resource(s)

Potential Terraform Configuration

provider "artifactory" { ... } # authorization happens here

data "artifactory_file" "lambda_function_xyz" {
  repository = "the-repository-key" #required
  path = "/this/is/just/a/sample/lambda-function-xyz-1.0.0.zip" #required
  output_path = "lambda-function-xyz-1.0.0.zip" #optional, if not set only the metadata are accessible, otherwise it will download the file contents to the given path
}

resource "aws_iam_role" "xyz" { ... }

resource "aws_lambda_function" "xyz" {
  function_name    = "xyz"
  filename         = data.artifactory_file.lambda_function_xyz.output_path
  role             = aws_iam_role.xyz.arn
  handler          = "index.handler"
  runtime          = "nodejs10.x"
  source_code_hash = data.artifactory_file.lambda_function_xyz.sha256
}

References

volkc-basf commented 4 years ago

@jamestoyer @ttsangAtlassian

Now that #65 is merged, could smbd. please provide a new release for us?

Thx. Chris

alexanderluiscampino commented 2 years ago

What's the status on this one?