-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59620f7
commit d940e31
Showing
92 changed files
with
4,960 additions
and
2,867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# DO NOT EDIT | ||
# EDIT .templates/examples.justfile.template instead | ||
set windows-shell := ["pwsh.exe", "-c"] | ||
|
||
run: | ||
cargo run -p pulumi_wasm_runner -- run --wasm ../../target/wasm32-wasi/debug/pulumi/pulumi_wasm_example_docker.wasm | ||
|
||
[windows] | ||
local-test: | ||
#!pwsh | ||
cargo run -p cargo-pulumi | ||
$env:PULUMI_CONFIG_PASSPHRASE=" " | ||
pulumi destroy -y | ||
pulumi up -y |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "pulumi_wasm_example_dependencies" | ||
version.workspace = true | ||
edition.workspace = true | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
anyhow.workspace = true | ||
pulumi_wasm_rust.workspace = true | ||
pulumi_wasm_random.workspace = true | ||
|
||
[dev-dependencies] | ||
assert_cmd.workspace = true | ||
predicates.workspace = true | ||
serde_json.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
encryptionsalt: v1:bBYmvuM1zu4=:v1:wcfRBO5+pEhKsHPm:ilCUcgZLePzhLhNyzrJYgrAZkhP0hQ== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name: Dependencies | ||
runtime: wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set windows-shell := ["pwsh.exe", "-c"] | ||
binary := "../../target/debug/pulumi_wasm_runner" | ||
wasm := "../../target/wasm32-wasi/debug/pulumi/pulumi_wasm_example_dependencies.wasm" | ||
|
||
run: | ||
{{binary}} run --wasm {{wasm}} | ||
|
||
[windows] | ||
local-test: | ||
#!pwsh | ||
cargo build -p pulumi_wasm_runner | ||
cargo run -p cargo-pulumi | ||
$env:PULUMI_CONFIG_PASSPHRASE=" " | ||
pulumi destroy -y | ||
pulumi up -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
use anyhow::Error; | ||
use pulumi_wasm_random::resource::random_string::{random_string, RandomStringArgs}; | ||
use pulumi_wasm_rust::Output; | ||
use pulumi_wasm_rust::{add_export, pulumi_main}; | ||
|
||
#[pulumi_main] | ||
fn test_main() -> Result<(), Error> { | ||
let length: Output<i32> = Output::new(&4); | ||
let random_string_1 = random_string( | ||
"test_1", | ||
RandomStringArgs { | ||
keepers: None.into(), | ||
length, | ||
lower: None.into(), | ||
min_lower: None.into(), | ||
min_numeric: None.into(), | ||
min_special: None.into(), | ||
min_upper: None.into(), | ||
number: None.into(), | ||
numeric: None.into(), | ||
override_special: None.into(), | ||
special: None.into(), | ||
upper: None.into(), | ||
}, | ||
); | ||
|
||
let new_length = random_string_1.result.map(|s| s.len() as i32); | ||
|
||
let random_string_2 = random_string( | ||
"test_2", | ||
RandomStringArgs { | ||
keepers: None.into(), | ||
length: new_length, | ||
lower: None.into(), | ||
min_lower: None.into(), | ||
min_numeric: None.into(), | ||
min_special: None.into(), | ||
min_upper: None.into(), | ||
number: None.into(), | ||
numeric: None.into(), | ||
override_special: None.into(), | ||
special: None.into(), | ||
upper: None.into(), | ||
}, | ||
); | ||
|
||
let random_string_3 = random_string( | ||
"test_3", | ||
RandomStringArgs { | ||
keepers: None.into(), | ||
length: random_string_2.length.map(|i| i * 2), | ||
lower: None.into(), | ||
min_lower: None.into(), | ||
min_numeric: None.into(), | ||
min_special: None.into(), | ||
min_upper: None.into(), | ||
number: None.into(), | ||
numeric: None.into(), | ||
override_special: None.into(), | ||
special: None.into(), | ||
upper: None.into(), | ||
}, | ||
); | ||
|
||
add_export("result", &random_string_1.result); | ||
add_export("number_1", &random_string_1.length); | ||
add_export("number_2", &random_string_2.length); | ||
add_export("number_3", &random_string_3.length); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use assert_cmd::prelude::*; | ||
use serde_json::Value; | ||
use std::process::Command; | ||
use std::str; | ||
|
||
#[test] | ||
fn test_integration() -> Result<(), anyhow::Error> { | ||
let github_token_env_vars = if let Ok(token) = std::env::var("GITHUB_TOKEN") { | ||
vec![("GITHUB_TOKEN".to_string(), token)] | ||
} else { | ||
vec![] | ||
}; | ||
|
||
Command::new("pulumi") | ||
.args(["stack", "init", "test"]) | ||
.env("PULUMI_CONFIG_PASSPHRASE", " ") | ||
.envs(github_token_env_vars.clone()) | ||
.current_dir(".") | ||
.output()?; | ||
|
||
Command::new("pulumi") | ||
.args(["stack", "select", "test"]) | ||
.current_dir(".") | ||
.assert() | ||
.success(); | ||
|
||
Command::new("pulumi") | ||
.args(["up", "-y"]) | ||
.current_dir(".") | ||
.env("PULUMI_CONFIG_PASSPHRASE", " ") | ||
.envs(github_token_env_vars) | ||
.assert() | ||
.success(); | ||
|
||
let binding = Command::new("pulumi") | ||
.args(["stack", "export"]) | ||
.current_dir(".") | ||
.env("PULUMI_CONFIG_PASSPHRASE", " ") | ||
.assert() | ||
.success(); | ||
let stack = &binding.get_output().stdout; | ||
|
||
let stack: Value = serde_json::from_str(str::from_utf8(stack)?)?; | ||
|
||
println!("{:#?}", stack); | ||
|
||
Ok(()) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.