stdlib: terraform support
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
24
tests/stdlib/terraform/s3/main.cue
Normal file
24
tests/stdlib/terraform/s3/main.cue
Normal file
@@ -0,0 +1,24 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
|
||||
"dagger.io/terraform"
|
||||
"dagger.io/aws"
|
||||
)
|
||||
|
||||
TestData: dagger.#Artifact
|
||||
|
||||
TestConfig: awsConfig: aws.#Config & {
|
||||
region: "us-east-2"
|
||||
}
|
||||
|
||||
TestTerraform: apply: terraform.#Configuration & {
|
||||
source: TestData
|
||||
env: {
|
||||
AWS_ACCESS_KEY_ID: TestConfig.awsConfig.accessKey
|
||||
AWS_SECRET_ACCESS_KEY: TestConfig.awsConfig.secretKey
|
||||
AWS_DEFAULT_REGION: TestConfig.awsConfig.region
|
||||
AWS_REGION: TestConfig.awsConfig.region
|
||||
}
|
||||
}
|
34
tests/stdlib/terraform/s3/testdata/test.tf
vendored
Normal file
34
tests/stdlib/terraform/s3/testdata/test.tf
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
random = {
|
||||
source = "hashicorp/random"
|
||||
version = "3.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
backend "s3" {
|
||||
bucket = "dagger-ci"
|
||||
key = "terraform/tfstate"
|
||||
region = "us-east-2"
|
||||
}
|
||||
}
|
||||
|
||||
provider "random" {
|
||||
}
|
||||
|
||||
variable "input" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "random_integer" "test" {
|
||||
min = 1
|
||||
max = 50
|
||||
}
|
||||
|
||||
output "random" {
|
||||
value = random_integer.test.result
|
||||
}
|
||||
|
||||
output "input" {
|
||||
value = var.input
|
||||
}
|
Reference in New Issue
Block a user