From 718ddee868553059a6821c2cad84afd13e24a9b6 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Wed, 17 Apr 2024 11:38:55 -0400 Subject: [PATCH] make build_sdks --- sdk/dotnet/AccessToken.cs | 48 +++++++++++ sdk/dotnet/AlpineRepository.cs | 43 ++++++++++ sdk/dotnet/Certificate.cs | 32 +++++++ sdk/dotnet/DebianRepository.cs | 67 +++++++++++++++ sdk/dotnet/DistributionPublicKey.cs | 25 ++++++ sdk/dotnet/Keypair.cs | 32 +++++++ sdk/dotnet/LocalRpmRepository.cs | 64 ++++++++++++++ sdk/dotnet/VirtualRpmRepository.cs | 60 +++++++++++++ sdk/go/artifactory/accessToken.go | 59 +++++++++++++ sdk/go/artifactory/alpineRepository.go | 54 ++++++++++++ sdk/go/artifactory/certificate.go | 44 ++++++++++ sdk/go/artifactory/debianRepository.go | 86 +++++++++++++++++++ sdk/go/artifactory/distributionPublicKey.go | 36 ++++++++ sdk/go/artifactory/keypair.go | 46 ++++++++++ sdk/go/artifactory/localRpmRepository.go | 84 ++++++++++++++++++ sdk/go/artifactory/virtualRpmRepository.go | 78 +++++++++++++++++ .../com/pulumi/artifactory/AccessToken.java | 54 ++++++++++++ .../pulumi/artifactory/AlpineRepository.java | 51 +++++++++++ .../com/pulumi/artifactory/Certificate.java | 44 ++++++++++ .../pulumi/artifactory/DebianRepository.java | 71 +++++++++++++++ .../artifactory/DistributionPublicKey.java | 36 ++++++++ .../java/com/pulumi/artifactory/Keypair.java | 42 +++++++++ .../artifactory/LocalRpmRepository.java | 70 +++++++++++++++ .../artifactory/VirtualRpmRepository.java | 66 ++++++++++++++ sdk/nodejs/accessToken.ts | 35 ++++++++ sdk/nodejs/alpineRepository.ts | 28 ++++++ sdk/nodejs/certificate.ts | 20 +++++ sdk/nodejs/debianRepository.ts | 49 +++++++++++ sdk/nodejs/distributionPublicKey.ts | 17 ++++ sdk/nodejs/keypair.ts | 23 +++++ sdk/nodejs/localRpmRepository.ts | 47 ++++++++++ sdk/nodejs/virtualRpmRepository.ts | 43 ++++++++++ sdk/python/pulumi_artifactory/access_token.py | 66 ++++++++++++++ .../pulumi_artifactory/alpine_repository.py | 42 +++++++++ sdk/python/pulumi_artifactory/certificate.py | 34 ++++++++ .../pulumi_artifactory/debian_repository.py | 74 ++++++++++++++++ .../distribution_public_key.py | 28 ++++++ sdk/python/pulumi_artifactory/keypair.py | 36 ++++++++ .../local_rpm_repository.py | 70 +++++++++++++++ .../virtual_rpm_repository.py | 62 +++++++++++++ 40 files changed, 1966 insertions(+) diff --git a/sdk/dotnet/AccessToken.cs b/sdk/dotnet/AccessToken.cs index 90c26068..cfa9619d 100644 --- a/sdk/dotnet/AccessToken.cs +++ b/sdk/dotnet/AccessToken.cs @@ -247,6 +247,54 @@ namespace Pulumi.Artifactory /// }); /// ``` /// <!--End PulumiCodeChooser --> + /// + /// ### Rotate token each pulumi up + /// This example will generate a token that will expire in 1 hour. + /// + /// If `pulumi up` is run before 1 hour, a new token is generated with an expiry of 1 hour. + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Artifactory = Pulumi.Artifactory; + /// using Std = Pulumi.Std; + /// using Time = Pulumiverse.Time; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var nowPlus1Hours = new Time.Rotating("now_plus_1_hours", new() + /// { + /// Triggers = + /// { + /// { "key", Std.Timestamp.Invoke().Apply(invoke => invoke.Result) }, + /// }, + /// RotationHours = 1, + /// }); + /// + /// var rotating = new Artifactory.AccessToken("rotating", new() + /// { + /// Username = "rotating", + /// EndDate = nowPlus1Hour.RotationRfc3339, + /// Groups = new[] + /// { + /// "readers", + /// }, + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// + /// ## References + /// + /// - https://www.jfrog.com/confluence/display/ACC1X/Access+Tokens + /// - https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-CreateToken + /// + /// ## Import + /// + /// Artifactory **does not** retain access tokens and cannot be imported into state. /// [ArtifactoryResourceType("artifactory:index/accessToken:AccessToken")] public partial class AccessToken : global::Pulumi.CustomResource diff --git a/sdk/dotnet/AlpineRepository.cs b/sdk/dotnet/AlpineRepository.cs index a551d866..7b4d7a8a 100644 --- a/sdk/dotnet/AlpineRepository.cs +++ b/sdk/dotnet/AlpineRepository.cs @@ -12,6 +12,49 @@ namespace Pulumi.Artifactory /// /// Creates a local Alpine repository. /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Artifactory = Pulumi.Artifactory; + /// using Std = Pulumi.Std; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var some_keypairRSA = new Artifactory.Keypair("some-keypairRSA", new() + /// { + /// PairName = "some-keypair", + /// PairType = "RSA", + /// Alias = "foo-alias", + /// PrivateKey = Std.File.Invoke(new() + /// { + /// Input = "samples/rsa.priv", + /// }).Apply(invoke => invoke.Result), + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/rsa.pub", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// var terraform_local_test_alpine_repo_basic = new Artifactory.AlpineRepository("terraform-local-test-alpine-repo-basic", new() + /// { + /// Key = "terraform-local-test-alpine-repo-basic", + /// PrimaryKeypairRef = some_keypairRSA.PairName, + /// }, new CustomResourceOptions + /// { + /// DependsOn = + /// { + /// some_keypairRSA, + /// }, + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// /// ## Import /// /// Local repositories can be imported using their name, e.g. diff --git a/sdk/dotnet/Certificate.cs b/sdk/dotnet/Certificate.cs index f062f252..59e08f80 100644 --- a/sdk/dotnet/Certificate.cs +++ b/sdk/dotnet/Certificate.cs @@ -12,6 +12,38 @@ namespace Pulumi.Artifactory /// /// Provides an Artifactory certificate resource. This can be used to create and manage Artifactory certificates which can be used as client authentication against remote repositories. /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Artifactory = Pulumi.Artifactory; + /// using Std = Pulumi.Std; + /// + /// return await Deployment.RunAsync(() => + /// { + /// // Create a new Artifactory certificate called my-cert + /// var my_cert = new Artifactory.Certificate("my-cert", new() + /// { + /// Alias = "my-cert", + /// Content = Std.File.Invoke(new() + /// { + /// Input = "/path/to/bundle.pem", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// // This can then be used by a remote repository + /// var my_remote = new Artifactory.RemoteMavenRepository("my-remote", new() + /// { + /// ClientTlsCertificate = my_cert.Alias, + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// /// ## Import /// /// Certificates can be imported using their alias, e.g. diff --git a/sdk/dotnet/DebianRepository.cs b/sdk/dotnet/DebianRepository.cs index 61320d89..f5e2f2c2 100644 --- a/sdk/dotnet/DebianRepository.cs +++ b/sdk/dotnet/DebianRepository.cs @@ -12,6 +12,73 @@ namespace Pulumi.Artifactory /// /// Creates a local Debian repository and allows for the creation of a GPG key. /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Artifactory = Pulumi.Artifactory; + /// using Std = Pulumi.Std; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var some_keypairGPG1 = new Artifactory.Keypair("some-keypairGPG1", new() + /// { + /// PairName = $"some-keypair{randid.Id}", + /// PairType = "GPG", + /// Alias = "foo-alias1", + /// PrivateKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.priv", + /// }).Apply(invoke => invoke.Result), + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.pub", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// var some_keypairGPG2 = new Artifactory.Keypair("some-keypairGPG2", new() + /// { + /// PairName = $"some-keypair4{randid.Id}", + /// PairType = "GPG", + /// Alias = "foo-alias2", + /// PrivateKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.priv", + /// }).Apply(invoke => invoke.Result), + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.pub", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// var my_debian_repo = new Artifactory.DebianRepository("my-debian-repo", new() + /// { + /// Key = "my-debian-repo", + /// PrimaryKeypairRef = some_keypairGPG1.PairName, + /// SecondaryKeypairRef = some_keypairGPG2.PairName, + /// IndexCompressionFormats = new[] + /// { + /// "bz2", + /// "lzma", + /// "xz", + /// }, + /// TrivialLayout = true, + /// }, new CustomResourceOptions + /// { + /// DependsOn = + /// { + /// some_keypairGPG1, + /// some_keypairGPG2, + /// }, + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// /// ## Import /// /// Local repositories can be imported using their name, e.g. diff --git a/sdk/dotnet/DistributionPublicKey.cs b/sdk/dotnet/DistributionPublicKey.cs index f8b65d26..9515f8bc 100644 --- a/sdk/dotnet/DistributionPublicKey.cs +++ b/sdk/dotnet/DistributionPublicKey.cs @@ -14,6 +14,31 @@ namespace Pulumi.Artifactory /// /// See [API description](https://jfrog.com/help/r/jfrog-rest-apis/set-distributionpublic-gpg-key) in the Artifactory documentation for more details. Also the [UI documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/managing-webstart-and-jar-signing) has further details on where to find these keys in Artifactory. /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Artifactory = Pulumi.Artifactory; + /// using Std = Pulumi.Std; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var my_key = new Artifactory.DistributionPublicKey("my-key", new() + /// { + /// Alias = "my-key", + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/rsa.pub", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// /// ## Import /// /// Distribution Public Key can be imported using the key id, e.g. diff --git a/sdk/dotnet/Keypair.cs b/sdk/dotnet/Keypair.cs index 574ee225..bb9e0388 100644 --- a/sdk/dotnet/Keypair.cs +++ b/sdk/dotnet/Keypair.cs @@ -13,6 +13,38 @@ namespace Pulumi.Artifactory /// RSA key pairs are used to sign and verify the Alpine Linux index files in JFrog Artifactory, while GPG key pairs are /// used to sign and validate packages integrity in JFrog Distribution. The JFrog Platform enables you to manage multiple RSA and GPG signing keys through the Keys Management UI and REST API. The JFrog Platform supports managing multiple pairs of GPG signing keys to sign packages for authentication of several package types such as Debian, Opkg, and RPM through the Keys Management UI and REST API. /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Artifactory = Pulumi.Artifactory; + /// using Std = Pulumi.Std; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var some_keypair_6543461672124900137 = new Artifactory.Keypair("some-keypair-6543461672124900137", new() + /// { + /// PairName = "some-keypair-6543461672124900137", + /// PairType = "RSA", + /// Alias = "some-alias-6543461672124900137", + /// PrivateKey = Std.File.Invoke(new() + /// { + /// Input = "samples/rsa.priv", + /// }).Apply(invoke => invoke.Result), + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/rsa.pub", + /// }).Apply(invoke => invoke.Result), + /// Passphrase = "PASSPHRASE", + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// /// ## Import /// /// Keypair can be imported using the pair name, e.g. diff --git a/sdk/dotnet/LocalRpmRepository.cs b/sdk/dotnet/LocalRpmRepository.cs index 0f85dd29..29e0cef4 100644 --- a/sdk/dotnet/LocalRpmRepository.cs +++ b/sdk/dotnet/LocalRpmRepository.cs @@ -12,6 +12,70 @@ namespace Pulumi.Artifactory /// /// Creates a local RPM repository. /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Artifactory = Pulumi.Artifactory; + /// using Std = Pulumi.Std; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var some_keypair_gpg_1 = new Artifactory.Keypair("some-keypair-gpg-1", new() + /// { + /// PairName = $"some-keypair{randid.Id}", + /// PairType = "GPG", + /// Alias = "foo-alias1", + /// PrivateKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.priv", + /// }).Apply(invoke => invoke.Result), + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.pub", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// var some_keypair_gpg_2 = new Artifactory.Keypair("some-keypair-gpg-2", new() + /// { + /// PairName = $"some-keypair{randid.Id}", + /// PairType = "GPG", + /// Alias = "foo-alias2", + /// PrivateKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.priv", + /// }).Apply(invoke => invoke.Result), + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.pub", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// var terraform_local_test_rpm_repo_basic = new Artifactory.LocalRpmRepository("terraform-local-test-rpm-repo-basic", new() + /// { + /// Key = "terraform-local-test-rpm-repo-basic", + /// YumRootDepth = 5, + /// CalculateYumMetadata = true, + /// EnableFileListsIndexing = true, + /// YumGroupFileNames = "file-1.xml,file-2.xml", + /// PrimaryKeypairRef = some_keypairGPG1.PairName, + /// SecondaryKeypairRef = some_keypairGPG2.PairName, + /// }, new CustomResourceOptions + /// { + /// DependsOn = + /// { + /// some_keypair_gpg_1, + /// some_keypair_gpg_2, + /// }, + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// /// ## Import /// /// Local repositories can be imported using their name, e.g. diff --git a/sdk/dotnet/VirtualRpmRepository.cs b/sdk/dotnet/VirtualRpmRepository.cs index 2fadb3d5..a93af4f5 100644 --- a/sdk/dotnet/VirtualRpmRepository.cs +++ b/sdk/dotnet/VirtualRpmRepository.cs @@ -13,6 +13,66 @@ namespace Pulumi.Artifactory /// Creates a virtual Rpm repository. /// Official documentation can be found [here](https://www.jfrog.com/confluence/display/JFROG/RPM+Repositories). /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Artifactory = Pulumi.Artifactory; + /// using Std = Pulumi.Std; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary_keypair = new Artifactory.Keypair("primary-keypair", new() + /// { + /// PairName = "primary-keypair", + /// PairType = "GPG", + /// Alias = "foo-alias-1", + /// PrivateKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.priv", + /// }).Apply(invoke => invoke.Result), + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.pub", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// var secondary_keypair = new Artifactory.Keypair("secondary-keypair", new() + /// { + /// PairName = "secondary-keypair", + /// PairType = "GPG", + /// Alias = "foo-alias-2", + /// PrivateKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.priv", + /// }).Apply(invoke => invoke.Result), + /// PublicKey = Std.File.Invoke(new() + /// { + /// Input = "samples/gpg.pub", + /// }).Apply(invoke => invoke.Result), + /// }); + /// + /// var foo_rpm_virtual = new Artifactory.VirtualRpmRepository("foo-rpm-virtual", new() + /// { + /// Key = "foo-rpm-virtual", + /// PrimaryKeypairRef = primary_keypair.PairName, + /// SecondaryKeypairRef = secondary_keypair.PairName, + /// }, new CustomResourceOptions + /// { + /// DependsOn = + /// { + /// primary_keypair, + /// secondary_keypair, + /// }, + /// }); + /// + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// /// ## Import /// /// Virtual repositories can be imported using their name, e.g. diff --git a/sdk/go/artifactory/accessToken.go b/sdk/go/artifactory/accessToken.go index 824bfe18..2744ab15 100644 --- a/sdk/go/artifactory/accessToken.go +++ b/sdk/go/artifactory/accessToken.go @@ -317,6 +317,65 @@ import ( // // ``` // +// +// ### Rotate token each pulumi up +// This example will generate a token that will expire in 1 hour. +// +// If `pulumi up` is run before 1 hour, a new token is generated with an expiry of 1 hour. +// +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi-time/sdk/go/time" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// invokeTimestamp, err := std.Timestamp(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = time.NewRotating(ctx, "now_plus_1_hours", &time.RotatingArgs{ +// Triggers: pulumi.StringMap{ +// "key": invokeTimestamp.Result, +// }, +// RotationHours: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = artifactory.NewAccessToken(ctx, "rotating", &artifactory.AccessTokenArgs{ +// Username: pulumi.String("rotating"), +// EndDate: pulumi.Any(nowPlus1Hour.RotationRfc3339), +// Groups: pulumi.StringArray{ +// pulumi.String("readers"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// +// ## References +// +// - https://www.jfrog.com/confluence/display/ACC1X/Access+Tokens +// - https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-CreateToken +// +// ## Import +// +// Artifactory **does not** retain access tokens and cannot be imported into state. type AccessToken struct { pulumi.CustomResourceState diff --git a/sdk/go/artifactory/alpineRepository.go b/sdk/go/artifactory/alpineRepository.go index bcdf7dc5..72e967de 100644 --- a/sdk/go/artifactory/alpineRepository.go +++ b/sdk/go/artifactory/alpineRepository.go @@ -14,6 +14,60 @@ import ( // Creates a local Alpine repository. // +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// invokeFile, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/rsa.priv", +// }, nil) +// if err != nil { +// return err +// } +// invokeFile1, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/rsa.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewKeypair(ctx, "some-keypairRSA", &artifactory.KeypairArgs{ +// PairName: pulumi.String("some-keypair"), +// PairType: pulumi.String("RSA"), +// Alias: pulumi.String("foo-alias"), +// PrivateKey: invokeFile.Result, +// PublicKey: invokeFile1.Result, +// }) +// if err != nil { +// return err +// } +// _, err = artifactory.NewAlpineRepository(ctx, "terraform-local-test-alpine-repo-basic", &artifactory.AlpineRepositoryArgs{ +// Key: pulumi.String("terraform-local-test-alpine-repo-basic"), +// PrimaryKeypairRef: some_keypairRSA.PairName, +// }, pulumi.DependsOn([]pulumi.Resource{ +// some_keypairRSA, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// // ## Import // // Local repositories can be imported using their name, e.g. diff --git a/sdk/go/artifactory/certificate.go b/sdk/go/artifactory/certificate.go index f2e7ce0c..c21fd3c9 100644 --- a/sdk/go/artifactory/certificate.go +++ b/sdk/go/artifactory/certificate.go @@ -14,6 +14,50 @@ import ( // Provides an Artifactory certificate resource. This can be used to create and manage Artifactory certificates which can be used as client authentication against remote repositories. // +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// invokeFile, err := std.File(ctx, &std.FileArgs{ +// Input: "/path/to/bundle.pem", +// }, nil) +// if err != nil { +// return err +// } +// // Create a new Artifactory certificate called my-cert +// _, err = artifactory.NewCertificate(ctx, "my-cert", &artifactory.CertificateArgs{ +// Alias: pulumi.String("my-cert"), +// Content: invokeFile.Result, +// }) +// if err != nil { +// return err +// } +// // This can then be used by a remote repository +// _, err = artifactory.NewRemoteMavenRepository(ctx, "my-remote", &artifactory.RemoteMavenRepositoryArgs{ +// ClientTlsCertificate: my_cert.Alias, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// // ## Import // // Certificates can be imported using their alias, e.g. diff --git a/sdk/go/artifactory/debianRepository.go b/sdk/go/artifactory/debianRepository.go index ce79b8ed..61fc52d8 100644 --- a/sdk/go/artifactory/debianRepository.go +++ b/sdk/go/artifactory/debianRepository.go @@ -14,6 +14,92 @@ import ( // Creates a local Debian repository and allows for the creation of a GPG key. // +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// invokeFile, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.priv", +// }, nil) +// if err != nil { +// return err +// } +// invokeFile1, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewKeypair(ctx, "some-keypairGPG1", &artifactory.KeypairArgs{ +// PairName: pulumi.String(fmt.Sprintf("some-keypair%v", randid.Id)), +// PairType: pulumi.String("GPG"), +// Alias: pulumi.String("foo-alias1"), +// PrivateKey: invokeFile.Result, +// PublicKey: invokeFile1.Result, +// }) +// if err != nil { +// return err +// } +// invokeFile2, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.priv", +// }, nil) +// if err != nil { +// return err +// } +// invokeFile3, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewKeypair(ctx, "some-keypairGPG2", &artifactory.KeypairArgs{ +// PairName: pulumi.String(fmt.Sprintf("some-keypair4%v", randid.Id)), +// PairType: pulumi.String("GPG"), +// Alias: pulumi.String("foo-alias2"), +// PrivateKey: invokeFile2.Result, +// PublicKey: invokeFile3.Result, +// }) +// if err != nil { +// return err +// } +// _, err = artifactory.NewDebianRepository(ctx, "my-debian-repo", &artifactory.DebianRepositoryArgs{ +// Key: pulumi.String("my-debian-repo"), +// PrimaryKeypairRef: some_keypairGPG1.PairName, +// SecondaryKeypairRef: some_keypairGPG2.PairName, +// IndexCompressionFormats: pulumi.StringArray{ +// pulumi.String("bz2"), +// pulumi.String("lzma"), +// pulumi.String("xz"), +// }, +// TrivialLayout: pulumi.Bool(true), +// }, pulumi.DependsOn([]pulumi.Resource{ +// some_keypairGPG1, +// some_keypairGPG2, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// // ## Import // // Local repositories can be imported using their name, e.g. diff --git a/sdk/go/artifactory/distributionPublicKey.go b/sdk/go/artifactory/distributionPublicKey.go index 49753bf7..c409f689 100644 --- a/sdk/go/artifactory/distributionPublicKey.go +++ b/sdk/go/artifactory/distributionPublicKey.go @@ -16,6 +16,42 @@ import ( // // See [API description](https://jfrog.com/help/r/jfrog-rest-apis/set-distributionpublic-gpg-key) in the Artifactory documentation for more details. Also the [UI documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/managing-webstart-and-jar-signing) has further details on where to find these keys in Artifactory. // +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// invokeFile, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/rsa.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewDistributionPublicKey(ctx, "my-key", &artifactory.DistributionPublicKeyArgs{ +// Alias: pulumi.String("my-key"), +// PublicKey: invokeFile.Result, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// // ## Import // // Distribution Public Key can be imported using the key id, e.g. diff --git a/sdk/go/artifactory/keypair.go b/sdk/go/artifactory/keypair.go index a981e35e..98ea6497 100644 --- a/sdk/go/artifactory/keypair.go +++ b/sdk/go/artifactory/keypair.go @@ -15,6 +15,52 @@ import ( // RSA key pairs are used to sign and verify the Alpine Linux index files in JFrog Artifactory, while GPG key pairs are // used to sign and validate packages integrity in JFrog Distribution. The JFrog Platform enables you to manage multiple RSA and GPG signing keys through the Keys Management UI and REST API. The JFrog Platform supports managing multiple pairs of GPG signing keys to sign packages for authentication of several package types such as Debian, Opkg, and RPM through the Keys Management UI and REST API. // +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// invokeFile, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/rsa.priv", +// }, nil) +// if err != nil { +// return err +// } +// invokeFile1, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/rsa.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewKeypair(ctx, "some-keypair-6543461672124900137", &artifactory.KeypairArgs{ +// PairName: pulumi.String("some-keypair-6543461672124900137"), +// PairType: pulumi.String("RSA"), +// Alias: pulumi.String("some-alias-6543461672124900137"), +// PrivateKey: invokeFile.Result, +// PublicKey: invokeFile1.Result, +// Passphrase: pulumi.String("PASSPHRASE"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// // ## Import // // Keypair can be imported using the pair name, e.g. diff --git a/sdk/go/artifactory/localRpmRepository.go b/sdk/go/artifactory/localRpmRepository.go index 511e248a..7cf0b324 100644 --- a/sdk/go/artifactory/localRpmRepository.go +++ b/sdk/go/artifactory/localRpmRepository.go @@ -14,6 +14,90 @@ import ( // Creates a local RPM repository. // +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// invokeFile, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.priv", +// }, nil) +// if err != nil { +// return err +// } +// invokeFile1, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewKeypair(ctx, "some-keypair-gpg-1", &artifactory.KeypairArgs{ +// PairName: pulumi.String(fmt.Sprintf("some-keypair%v", randid.Id)), +// PairType: pulumi.String("GPG"), +// Alias: pulumi.String("foo-alias1"), +// PrivateKey: invokeFile.Result, +// PublicKey: invokeFile1.Result, +// }) +// if err != nil { +// return err +// } +// invokeFile2, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.priv", +// }, nil) +// if err != nil { +// return err +// } +// invokeFile3, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewKeypair(ctx, "some-keypair-gpg-2", &artifactory.KeypairArgs{ +// PairName: pulumi.String(fmt.Sprintf("some-keypair%v", randid.Id)), +// PairType: pulumi.String("GPG"), +// Alias: pulumi.String("foo-alias2"), +// PrivateKey: invokeFile2.Result, +// PublicKey: invokeFile3.Result, +// }) +// if err != nil { +// return err +// } +// _, err = artifactory.NewLocalRpmRepository(ctx, "terraform-local-test-rpm-repo-basic", &artifactory.LocalRpmRepositoryArgs{ +// Key: pulumi.String("terraform-local-test-rpm-repo-basic"), +// YumRootDepth: pulumi.Int(5), +// CalculateYumMetadata: pulumi.Bool(true), +// EnableFileListsIndexing: pulumi.Bool(true), +// YumGroupFileNames: pulumi.String("file-1.xml,file-2.xml"), +// PrimaryKeypairRef: pulumi.Any(some_keypairGPG1.PairName), +// SecondaryKeypairRef: pulumi.Any(some_keypairGPG2.PairName), +// }, pulumi.DependsOn([]pulumi.Resource{ +// some_keypair_gpg_1, +// some_keypair_gpg_2, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// // ## Import // // Local repositories can be imported using their name, e.g. diff --git a/sdk/go/artifactory/virtualRpmRepository.go b/sdk/go/artifactory/virtualRpmRepository.go index fad84364..5c20f5ad 100644 --- a/sdk/go/artifactory/virtualRpmRepository.go +++ b/sdk/go/artifactory/virtualRpmRepository.go @@ -15,6 +15,84 @@ import ( // Creates a virtual Rpm repository. // Official documentation can be found [here](https://www.jfrog.com/confluence/display/JFROG/RPM+Repositories). // +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// invokeFile, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.priv", +// }, nil) +// if err != nil { +// return err +// } +// invokeFile1, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewKeypair(ctx, "primary-keypair", &artifactory.KeypairArgs{ +// PairName: pulumi.String("primary-keypair"), +// PairType: pulumi.String("GPG"), +// Alias: pulumi.String("foo-alias-1"), +// PrivateKey: invokeFile.Result, +// PublicKey: invokeFile1.Result, +// }) +// if err != nil { +// return err +// } +// invokeFile2, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.priv", +// }, nil) +// if err != nil { +// return err +// } +// invokeFile3, err := std.File(ctx, &std.FileArgs{ +// Input: "samples/gpg.pub", +// }, nil) +// if err != nil { +// return err +// } +// _, err = artifactory.NewKeypair(ctx, "secondary-keypair", &artifactory.KeypairArgs{ +// PairName: pulumi.String("secondary-keypair"), +// PairType: pulumi.String("GPG"), +// Alias: pulumi.String("foo-alias-2"), +// PrivateKey: invokeFile2.Result, +// PublicKey: invokeFile3.Result, +// }) +// if err != nil { +// return err +// } +// _, err = artifactory.NewVirtualRpmRepository(ctx, "foo-rpm-virtual", &artifactory.VirtualRpmRepositoryArgs{ +// Key: pulumi.String("foo-rpm-virtual"), +// PrimaryKeypairRef: primary_keypair.PairName, +// SecondaryKeypairRef: secondary_keypair.PairName, +// }, pulumi.DependsOn([]pulumi.Resource{ +// primary_keypair, +// secondary_keypair, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// // ## Import // // Virtual repositories can be imported using their name, e.g. diff --git a/sdk/java/src/main/java/com/pulumi/artifactory/AccessToken.java b/sdk/java/src/main/java/com/pulumi/artifactory/AccessToken.java index 95b050d9..cef0ca31 100644 --- a/sdk/java/src/main/java/com/pulumi/artifactory/AccessToken.java +++ b/sdk/java/src/main/java/com/pulumi/artifactory/AccessToken.java @@ -359,6 +359,60 @@ * ``` * <!--End PulumiCodeChooser --> * + * ### Rotate token each pulumi up + * This example will generate a token that will expire in 1 hour. + * + * If `pulumi up` is run before 1 hour, a new token is generated with an expiry of 1 hour. + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.time.Rotating; + * import com.pulumi.time.RotatingArgs; + * import com.pulumi.artifactory.AccessToken; + * import com.pulumi.artifactory.AccessTokenArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var nowPlus1Hours = new Rotating("nowPlus1Hours", RotatingArgs.builder() + * .triggers(Map.of("key", StdFunctions.timestamp().result())) + * .rotationHours("1") + * .build()); + * + * var rotating = new AccessToken("rotating", AccessTokenArgs.builder() + * .username("rotating") + * .endDate(nowPlus1Hour.rotationRfc3339()) + * .groups("readers") + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * + * ## References + * + * - https://www.jfrog.com/confluence/display/ACC1X/Access+Tokens + * - https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-CreateToken + * + * ## Import + * + * Artifactory **does not** retain access tokens and cannot be imported into state. + * */ @ResourceType(type="artifactory:index/accessToken:AccessToken") public class AccessToken extends com.pulumi.resources.CustomResource { diff --git a/sdk/java/src/main/java/com/pulumi/artifactory/AlpineRepository.java b/sdk/java/src/main/java/com/pulumi/artifactory/AlpineRepository.java index cd859f52..c74d9f71 100644 --- a/sdk/java/src/main/java/com/pulumi/artifactory/AlpineRepository.java +++ b/sdk/java/src/main/java/com/pulumi/artifactory/AlpineRepository.java @@ -19,6 +19,57 @@ /** * Creates a local Alpine repository. * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.artifactory.Keypair; + * import com.pulumi.artifactory.KeypairArgs; + * import com.pulumi.artifactory.AlpineRepository; + * import com.pulumi.artifactory.AlpineRepositoryArgs; + * import com.pulumi.resources.CustomResourceOptions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var some_keypairRSA = new Keypair("some-keypairRSA", KeypairArgs.builder() + * .pairName("some-keypair") + * .pairType("RSA") + * .alias("foo-alias") + * .privateKey(StdFunctions.file(FileArgs.builder() + * .input("samples/rsa.priv") + * .build()).result()) + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/rsa.pub") + * .build()).result()) + * .build()); + * + * var terraform_local_test_alpine_repo_basic = new AlpineRepository("terraform-local-test-alpine-repo-basic", AlpineRepositoryArgs.builder() + * .key("terraform-local-test-alpine-repo-basic") + * .primaryKeypairRef(some_keypairRSA.pairName()) + * .build(), CustomResourceOptions.builder() + * .dependsOn(some_keypairRSA) + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * * ## Import * * Local repositories can be imported using their name, e.g. diff --git a/sdk/java/src/main/java/com/pulumi/artifactory/Certificate.java b/sdk/java/src/main/java/com/pulumi/artifactory/Certificate.java index 51a5f976..0549b940 100644 --- a/sdk/java/src/main/java/com/pulumi/artifactory/Certificate.java +++ b/sdk/java/src/main/java/com/pulumi/artifactory/Certificate.java @@ -18,6 +18,50 @@ /** * Provides an Artifactory certificate resource. This can be used to create and manage Artifactory certificates which can be used as client authentication against remote repositories. * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.artifactory.Certificate; + * import com.pulumi.artifactory.CertificateArgs; + * import com.pulumi.artifactory.RemoteMavenRepository; + * import com.pulumi.artifactory.RemoteMavenRepositoryArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * // Create a new Artifactory certificate called my-cert + * var my_cert = new Certificate("my-cert", CertificateArgs.builder() + * .alias("my-cert") + * .content(StdFunctions.file(FileArgs.builder() + * .input("/path/to/bundle.pem") + * .build()).result()) + * .build()); + * + * // This can then be used by a remote repository + * var my_remote = new RemoteMavenRepository("my-remote", RemoteMavenRepositoryArgs.builder() + * .clientTlsCertificate(my_cert.alias()) + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * * ## Import * * Certificates can be imported using their alias, e.g. diff --git a/sdk/java/src/main/java/com/pulumi/artifactory/DebianRepository.java b/sdk/java/src/main/java/com/pulumi/artifactory/DebianRepository.java index 28c334df..dad5c063 100644 --- a/sdk/java/src/main/java/com/pulumi/artifactory/DebianRepository.java +++ b/sdk/java/src/main/java/com/pulumi/artifactory/DebianRepository.java @@ -19,6 +19,77 @@ /** * Creates a local Debian repository and allows for the creation of a GPG key. * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.artifactory.Keypair; + * import com.pulumi.artifactory.KeypairArgs; + * import com.pulumi.artifactory.DebianRepository; + * import com.pulumi.artifactory.DebianRepositoryArgs; + * import com.pulumi.resources.CustomResourceOptions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var some_keypairGPG1 = new Keypair("some-keypairGPG1", KeypairArgs.builder() + * .pairName(String.format("some-keypair%s", randid.id())) + * .pairType("GPG") + * .alias("foo-alias1") + * .privateKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.priv") + * .build()).result()) + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.pub") + * .build()).result()) + * .build()); + * + * var some_keypairGPG2 = new Keypair("some-keypairGPG2", KeypairArgs.builder() + * .pairName(String.format("some-keypair4%s", randid.id())) + * .pairType("GPG") + * .alias("foo-alias2") + * .privateKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.priv") + * .build()).result()) + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.pub") + * .build()).result()) + * .build()); + * + * var my_debian_repo = new DebianRepository("my-debian-repo", DebianRepositoryArgs.builder() + * .key("my-debian-repo") + * .primaryKeypairRef(some_keypairGPG1.pairName()) + * .secondaryKeypairRef(some_keypairGPG2.pairName()) + * .indexCompressionFormats( + * "bz2", + * "lzma", + * "xz") + * .trivialLayout(true) + * .build(), CustomResourceOptions.builder() + * .dependsOn( + * some_keypairGPG1, + * some_keypairGPG2) + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * * ## Import * * Local repositories can be imported using their name, e.g. diff --git a/sdk/java/src/main/java/com/pulumi/artifactory/DistributionPublicKey.java b/sdk/java/src/main/java/com/pulumi/artifactory/DistributionPublicKey.java index e26e57fc..4744e98e 100644 --- a/sdk/java/src/main/java/com/pulumi/artifactory/DistributionPublicKey.java +++ b/sdk/java/src/main/java/com/pulumi/artifactory/DistributionPublicKey.java @@ -18,6 +18,42 @@ * * See [API description](https://jfrog.com/help/r/jfrog-rest-apis/set-distributionpublic-gpg-key) in the Artifactory documentation for more details. Also the [UI documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/managing-webstart-and-jar-signing) has further details on where to find these keys in Artifactory. * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.artifactory.DistributionPublicKey; + * import com.pulumi.artifactory.DistributionPublicKeyArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var my_key = new DistributionPublicKey("my-key", DistributionPublicKeyArgs.builder() + * .alias("my-key") + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/rsa.pub") + * .build()).result()) + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * * ## Import * * Distribution Public Key can be imported using the key id, e.g. diff --git a/sdk/java/src/main/java/com/pulumi/artifactory/Keypair.java b/sdk/java/src/main/java/com/pulumi/artifactory/Keypair.java index f68c24b7..8d30f125 100644 --- a/sdk/java/src/main/java/com/pulumi/artifactory/Keypair.java +++ b/sdk/java/src/main/java/com/pulumi/artifactory/Keypair.java @@ -19,6 +19,48 @@ * RSA key pairs are used to sign and verify the Alpine Linux index files in JFrog Artifactory, while GPG key pairs are * used to sign and validate packages integrity in JFrog Distribution. The JFrog Platform enables you to manage multiple RSA and GPG signing keys through the Keys Management UI and REST API. The JFrog Platform supports managing multiple pairs of GPG signing keys to sign packages for authentication of several package types such as Debian, Opkg, and RPM through the Keys Management UI and REST API. * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.artifactory.Keypair; + * import com.pulumi.artifactory.KeypairArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var some_keypair_6543461672124900137 = new Keypair("some-keypair-6543461672124900137", KeypairArgs.builder() + * .pairName("some-keypair-6543461672124900137") + * .pairType("RSA") + * .alias("some-alias-6543461672124900137") + * .privateKey(StdFunctions.file(FileArgs.builder() + * .input("samples/rsa.priv") + * .build()).result()) + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/rsa.pub") + * .build()).result()) + * .passphrase("PASSPHRASE") + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * * ## Import * * Keypair can be imported using the pair name, e.g. diff --git a/sdk/java/src/main/java/com/pulumi/artifactory/LocalRpmRepository.java b/sdk/java/src/main/java/com/pulumi/artifactory/LocalRpmRepository.java index 065120a4..c00eb86e 100644 --- a/sdk/java/src/main/java/com/pulumi/artifactory/LocalRpmRepository.java +++ b/sdk/java/src/main/java/com/pulumi/artifactory/LocalRpmRepository.java @@ -20,6 +20,76 @@ /** * Creates a local RPM repository. * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.artifactory.Keypair; + * import com.pulumi.artifactory.KeypairArgs; + * import com.pulumi.artifactory.LocalRpmRepository; + * import com.pulumi.artifactory.LocalRpmRepositoryArgs; + * import com.pulumi.resources.CustomResourceOptions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var some_keypair_gpg_1 = new Keypair("some-keypair-gpg-1", KeypairArgs.builder() + * .pairName(String.format("some-keypair%s", randid.id())) + * .pairType("GPG") + * .alias("foo-alias1") + * .privateKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.priv") + * .build()).result()) + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.pub") + * .build()).result()) + * .build()); + * + * var some_keypair_gpg_2 = new Keypair("some-keypair-gpg-2", KeypairArgs.builder() + * .pairName(String.format("some-keypair%s", randid.id())) + * .pairType("GPG") + * .alias("foo-alias2") + * .privateKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.priv") + * .build()).result()) + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.pub") + * .build()).result()) + * .build()); + * + * var terraform_local_test_rpm_repo_basic = new LocalRpmRepository("terraform-local-test-rpm-repo-basic", LocalRpmRepositoryArgs.builder() + * .key("terraform-local-test-rpm-repo-basic") + * .yumRootDepth(5) + * .calculateYumMetadata(true) + * .enableFileListsIndexing(true) + * .yumGroupFileNames("file-1.xml,file-2.xml") + * .primaryKeypairRef(some_keypairGPG1.pairName()) + * .secondaryKeypairRef(some_keypairGPG2.pairName()) + * .build(), CustomResourceOptions.builder() + * .dependsOn( + * some_keypair_gpg_1, + * some_keypair_gpg_2) + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * * ## Import * * Local repositories can be imported using their name, e.g. diff --git a/sdk/java/src/main/java/com/pulumi/artifactory/VirtualRpmRepository.java b/sdk/java/src/main/java/com/pulumi/artifactory/VirtualRpmRepository.java index 710a13e3..83610a3e 100644 --- a/sdk/java/src/main/java/com/pulumi/artifactory/VirtualRpmRepository.java +++ b/sdk/java/src/main/java/com/pulumi/artifactory/VirtualRpmRepository.java @@ -20,6 +20,72 @@ * Creates a virtual Rpm repository. * Official documentation can be found [here](https://www.jfrog.com/confluence/display/JFROG/RPM+Repositories). * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.artifactory.Keypair; + * import com.pulumi.artifactory.KeypairArgs; + * import com.pulumi.artifactory.VirtualRpmRepository; + * import com.pulumi.artifactory.VirtualRpmRepositoryArgs; + * import com.pulumi.resources.CustomResourceOptions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var primary_keypair = new Keypair("primary-keypair", KeypairArgs.builder() + * .pairName("primary-keypair") + * .pairType("GPG") + * .alias("foo-alias-1") + * .privateKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.priv") + * .build()).result()) + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.pub") + * .build()).result()) + * .build()); + * + * var secondary_keypair = new Keypair("secondary-keypair", KeypairArgs.builder() + * .pairName("secondary-keypair") + * .pairType("GPG") + * .alias("foo-alias-2") + * .privateKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.priv") + * .build()).result()) + * .publicKey(StdFunctions.file(FileArgs.builder() + * .input("samples/gpg.pub") + * .build()).result()) + * .build()); + * + * var foo_rpm_virtual = new VirtualRpmRepository("foo-rpm-virtual", VirtualRpmRepositoryArgs.builder() + * .key("foo-rpm-virtual") + * .primaryKeypairRef(primary_keypair.pairName()) + * .secondaryKeypairRef(secondary_keypair.pairName()) + * .build(), CustomResourceOptions.builder() + * .dependsOn( + * primary_keypair, + * secondary_keypair) + * .build()); + * + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * * ## Import * * Virtual repositories can be imported using their name, e.g. diff --git a/sdk/nodejs/accessToken.ts b/sdk/nodejs/accessToken.ts index 413488d0..42d2ec31 100644 --- a/sdk/nodejs/accessToken.ts +++ b/sdk/nodejs/accessToken.ts @@ -159,6 +159,41 @@ import * as utilities from "./utilities"; * }); * ``` * + * + * ### Rotate token each pulumi up + * This example will generate a token that will expire in 1 hour. + * + * If `pulumi up` is run before 1 hour, a new token is generated with an expiry of 1 hour. + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as artifactory from "@pulumi/artifactory"; + * import * as std from "@pulumi/std"; + * import * as time from "@pulumiverse/time"; + * + * const nowPlus1Hours = new time.Rotating("now_plus_1_hours", { + * triggers: { + * key: std.timestamp({}).then(invoke => invoke.result), + * }, + * rotationHours: 1, + * }); + * const rotating = new artifactory.AccessToken("rotating", { + * username: "rotating", + * endDate: nowPlus1Hour.rotationRfc3339, + * groups: ["readers"], + * }); + * ``` + * + * + * ## References + * + * - https://www.jfrog.com/confluence/display/ACC1X/Access+Tokens + * - https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-CreateToken + * + * ## Import + * + * Artifactory **does not** retain access tokens and cannot be imported into state. */ export class AccessToken extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/alpineRepository.ts b/sdk/nodejs/alpineRepository.ts index 11960a48..634ff903 100644 --- a/sdk/nodejs/alpineRepository.ts +++ b/sdk/nodejs/alpineRepository.ts @@ -7,6 +7,34 @@ import * as utilities from "./utilities"; /** * Creates a local Alpine repository. * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as artifactory from "@pulumi/artifactory"; + * import * as std from "@pulumi/std"; + * + * const some_keypairRSA = new artifactory.Keypair("some-keypairRSA", { + * pairName: "some-keypair", + * pairType: "RSA", + * alias: "foo-alias", + * privateKey: std.file({ + * input: "samples/rsa.priv", + * }).then(invoke => invoke.result), + * publicKey: std.file({ + * input: "samples/rsa.pub", + * }).then(invoke => invoke.result), + * }); + * const terraform_local_test_alpine_repo_basic = new artifactory.AlpineRepository("terraform-local-test-alpine-repo-basic", { + * key: "terraform-local-test-alpine-repo-basic", + * primaryKeypairRef: some_keypairRSA.pairName, + * }, { + * dependsOn: [some_keypairRSA], + * }); + * ``` + * + * * ## Import * * Local repositories can be imported using their name, e.g. diff --git a/sdk/nodejs/certificate.ts b/sdk/nodejs/certificate.ts index 5aed4c46..1acdf419 100644 --- a/sdk/nodejs/certificate.ts +++ b/sdk/nodejs/certificate.ts @@ -7,6 +7,26 @@ import * as utilities from "./utilities"; /** * Provides an Artifactory certificate resource. This can be used to create and manage Artifactory certificates which can be used as client authentication against remote repositories. * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as artifactory from "@pulumi/artifactory"; + * import * as std from "@pulumi/std"; + * + * // Create a new Artifactory certificate called my-cert + * const my_cert = new artifactory.Certificate("my-cert", { + * alias: "my-cert", + * content: std.file({ + * input: "/path/to/bundle.pem", + * }).then(invoke => invoke.result), + * }); + * // This can then be used by a remote repository + * const my_remote = new artifactory.RemoteMavenRepository("my-remote", {clientTlsCertificate: my_cert.alias}); + * ``` + * + * * ## Import * * Certificates can be imported using their alias, e.g. diff --git a/sdk/nodejs/debianRepository.ts b/sdk/nodejs/debianRepository.ts index 47c1ba58..333522e4 100644 --- a/sdk/nodejs/debianRepository.ts +++ b/sdk/nodejs/debianRepository.ts @@ -7,6 +7,55 @@ import * as utilities from "./utilities"; /** * Creates a local Debian repository and allows for the creation of a GPG key. * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as artifactory from "@pulumi/artifactory"; + * import * as std from "@pulumi/std"; + * + * const some_keypairGPG1 = new artifactory.Keypair("some-keypairGPG1", { + * pairName: `some-keypair${randid.id}`, + * pairType: "GPG", + * alias: "foo-alias1", + * privateKey: std.file({ + * input: "samples/gpg.priv", + * }).then(invoke => invoke.result), + * publicKey: std.file({ + * input: "samples/gpg.pub", + * }).then(invoke => invoke.result), + * }); + * const some_keypairGPG2 = new artifactory.Keypair("some-keypairGPG2", { + * pairName: `some-keypair4${randid.id}`, + * pairType: "GPG", + * alias: "foo-alias2", + * privateKey: std.file({ + * input: "samples/gpg.priv", + * }).then(invoke => invoke.result), + * publicKey: std.file({ + * input: "samples/gpg.pub", + * }).then(invoke => invoke.result), + * }); + * const my_debian_repo = new artifactory.DebianRepository("my-debian-repo", { + * key: "my-debian-repo", + * primaryKeypairRef: some_keypairGPG1.pairName, + * secondaryKeypairRef: some_keypairGPG2.pairName, + * indexCompressionFormats: [ + * "bz2", + * "lzma", + * "xz", + * ], + * trivialLayout: true, + * }, { + * dependsOn: [ + * some_keypairGPG1, + * some_keypairGPG2, + * ], + * }); + * ``` + * + * * ## Import * * Local repositories can be imported using their name, e.g. diff --git a/sdk/nodejs/distributionPublicKey.ts b/sdk/nodejs/distributionPublicKey.ts index 64ee16d9..26588904 100644 --- a/sdk/nodejs/distributionPublicKey.ts +++ b/sdk/nodejs/distributionPublicKey.ts @@ -9,6 +9,23 @@ import * as utilities from "./utilities"; * * See [API description](https://jfrog.com/help/r/jfrog-rest-apis/set-distributionpublic-gpg-key) in the Artifactory documentation for more details. Also the [UI documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/managing-webstart-and-jar-signing) has further details on where to find these keys in Artifactory. * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as artifactory from "@pulumi/artifactory"; + * import * as std from "@pulumi/std"; + * + * const my_key = new artifactory.DistributionPublicKey("my-key", { + * alias: "my-key", + * publicKey: std.file({ + * input: "samples/rsa.pub", + * }).then(invoke => invoke.result), + * }); + * ``` + * + * * ## Import * * Distribution Public Key can be imported using the key id, e.g. diff --git a/sdk/nodejs/keypair.ts b/sdk/nodejs/keypair.ts index 0d4a6262..ad355ff4 100644 --- a/sdk/nodejs/keypair.ts +++ b/sdk/nodejs/keypair.ts @@ -8,6 +8,29 @@ import * as utilities from "./utilities"; * RSA key pairs are used to sign and verify the Alpine Linux index files in JFrog Artifactory, while GPG key pairs are * used to sign and validate packages integrity in JFrog Distribution. The JFrog Platform enables you to manage multiple RSA and GPG signing keys through the Keys Management UI and REST API. The JFrog Platform supports managing multiple pairs of GPG signing keys to sign packages for authentication of several package types such as Debian, Opkg, and RPM through the Keys Management UI and REST API. * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as artifactory from "@pulumi/artifactory"; + * import * as std from "@pulumi/std"; + * + * const some_keypair_6543461672124900137 = new artifactory.Keypair("some-keypair-6543461672124900137", { + * pairName: "some-keypair-6543461672124900137", + * pairType: "RSA", + * alias: "some-alias-6543461672124900137", + * privateKey: std.file({ + * input: "samples/rsa.priv", + * }).then(invoke => invoke.result), + * publicKey: std.file({ + * input: "samples/rsa.pub", + * }).then(invoke => invoke.result), + * passphrase: "PASSPHRASE", + * }); + * ``` + * + * * ## Import * * Keypair can be imported using the pair name, e.g. diff --git a/sdk/nodejs/localRpmRepository.ts b/sdk/nodejs/localRpmRepository.ts index 37bdc273..f75cdfa6 100644 --- a/sdk/nodejs/localRpmRepository.ts +++ b/sdk/nodejs/localRpmRepository.ts @@ -7,6 +7,53 @@ import * as utilities from "./utilities"; /** * Creates a local RPM repository. * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as artifactory from "@pulumi/artifactory"; + * import * as std from "@pulumi/std"; + * + * const some_keypair_gpg_1 = new artifactory.Keypair("some-keypair-gpg-1", { + * pairName: `some-keypair${randid.id}`, + * pairType: "GPG", + * alias: "foo-alias1", + * privateKey: std.file({ + * input: "samples/gpg.priv", + * }).then(invoke => invoke.result), + * publicKey: std.file({ + * input: "samples/gpg.pub", + * }).then(invoke => invoke.result), + * }); + * const some_keypair_gpg_2 = new artifactory.Keypair("some-keypair-gpg-2", { + * pairName: `some-keypair${randid.id}`, + * pairType: "GPG", + * alias: "foo-alias2", + * privateKey: std.file({ + * input: "samples/gpg.priv", + * }).then(invoke => invoke.result), + * publicKey: std.file({ + * input: "samples/gpg.pub", + * }).then(invoke => invoke.result), + * }); + * const terraform_local_test_rpm_repo_basic = new artifactory.LocalRpmRepository("terraform-local-test-rpm-repo-basic", { + * key: "terraform-local-test-rpm-repo-basic", + * yumRootDepth: 5, + * calculateYumMetadata: true, + * enableFileListsIndexing: true, + * yumGroupFileNames: "file-1.xml,file-2.xml", + * primaryKeypairRef: some_keypairGPG1.pairName, + * secondaryKeypairRef: some_keypairGPG2.pairName, + * }, { + * dependsOn: [ + * some_keypair_gpg_1, + * some_keypair_gpg_2, + * ], + * }); + * ``` + * + * * ## Import * * Local repositories can be imported using their name, e.g. diff --git a/sdk/nodejs/virtualRpmRepository.ts b/sdk/nodejs/virtualRpmRepository.ts index 52c44f4f..03b6860b 100644 --- a/sdk/nodejs/virtualRpmRepository.ts +++ b/sdk/nodejs/virtualRpmRepository.ts @@ -8,6 +8,49 @@ import * as utilities from "./utilities"; * Creates a virtual Rpm repository. * Official documentation can be found [here](https://www.jfrog.com/confluence/display/JFROG/RPM+Repositories). * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as artifactory from "@pulumi/artifactory"; + * import * as std from "@pulumi/std"; + * + * const primary_keypair = new artifactory.Keypair("primary-keypair", { + * pairName: "primary-keypair", + * pairType: "GPG", + * alias: "foo-alias-1", + * privateKey: std.file({ + * input: "samples/gpg.priv", + * }).then(invoke => invoke.result), + * publicKey: std.file({ + * input: "samples/gpg.pub", + * }).then(invoke => invoke.result), + * }); + * const secondary_keypair = new artifactory.Keypair("secondary-keypair", { + * pairName: "secondary-keypair", + * pairType: "GPG", + * alias: "foo-alias-2", + * privateKey: std.file({ + * input: "samples/gpg.priv", + * }).then(invoke => invoke.result), + * publicKey: std.file({ + * input: "samples/gpg.pub", + * }).then(invoke => invoke.result), + * }); + * const foo_rpm_virtual = new artifactory.VirtualRpmRepository("foo-rpm-virtual", { + * key: "foo-rpm-virtual", + * primaryKeypairRef: primary_keypair.pairName, + * secondaryKeypairRef: secondary_keypair.pairName, + * }, { + * dependsOn: [ + * primary_keypair, + * secondary_keypair, + * ], + * }); + * ``` + * + * * ## Import * * Virtual repositories can be imported using their name, e.g. diff --git a/sdk/python/pulumi_artifactory/access_token.py b/sdk/python/pulumi_artifactory/access_token.py index 076f9aed..94705e0d 100644 --- a/sdk/python/pulumi_artifactory/access_token.py +++ b/sdk/python/pulumi_artifactory/access_token.py @@ -441,6 +441,39 @@ def __init__(__self__, ``` + ### Rotate token each pulumi up + This example will generate a token that will expire in 1 hour. + + If `pulumi up` is run before 1 hour, a new token is generated with an expiry of 1 hour. + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + import pulumiverse_time as time + + now_plus1_hours = time.Rotating("now_plus_1_hours", + triggers={ + "key": std.timestamp().result, + }, + rotation_hours=1) + rotating = artifactory.AccessToken("rotating", + username="rotating", + end_date=now_plus1_hour["rotationRfc3339"], + groups=["readers"]) + ``` + + + ## References + + - https://www.jfrog.com/confluence/display/ACC1X/Access+Tokens + - https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-CreateToken + + ## Import + + Artifactory **does not** retain access tokens and cannot be imported into state. + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[pulumi.InputType['AccessTokenAdminTokenArgs']] admin_token: (Optional) Specify the `instance_id` in this block to grant this token admin privileges. This can only be created when the authenticated user is an admin. `admin_token` cannot be specified with `groups`. @@ -601,6 +634,39 @@ def __init__(__self__, ``` + ### Rotate token each pulumi up + This example will generate a token that will expire in 1 hour. + + If `pulumi up` is run before 1 hour, a new token is generated with an expiry of 1 hour. + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + import pulumiverse_time as time + + now_plus1_hours = time.Rotating("now_plus_1_hours", + triggers={ + "key": std.timestamp().result, + }, + rotation_hours=1) + rotating = artifactory.AccessToken("rotating", + username="rotating", + end_date=now_plus1_hour["rotationRfc3339"], + groups=["readers"]) + ``` + + + ## References + + - https://www.jfrog.com/confluence/display/ACC1X/Access+Tokens + - https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-CreateToken + + ## Import + + Artifactory **does not** retain access tokens and cannot be imported into state. + :param str resource_name: The name of the resource. :param AccessTokenArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_artifactory/alpine_repository.py b/sdk/python/pulumi_artifactory/alpine_repository.py index 87563644..be355f47 100644 --- a/sdk/python/pulumi_artifactory/alpine_repository.py +++ b/sdk/python/pulumi_artifactory/alpine_repository.py @@ -648,6 +648,27 @@ def __init__(__self__, """ Creates a local Alpine repository. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + some_keypair_rsa = artifactory.Keypair("some-keypairRSA", + pair_name="some-keypair", + pair_type="RSA", + alias="foo-alias", + private_key=std.file(input="samples/rsa.priv").result, + public_key=std.file(input="samples/rsa.pub").result) + terraform_local_test_alpine_repo_basic = artifactory.AlpineRepository("terraform-local-test-alpine-repo-basic", + key="terraform-local-test-alpine-repo-basic", + primary_keypair_ref=some_keypair_rsa.pair_name, + opts=pulumi.ResourceOptions(depends_on=[some_keypair_rsa])) + ``` + + ## Import Local repositories can be imported using their name, e.g. @@ -696,6 +717,27 @@ def __init__(__self__, """ Creates a local Alpine repository. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + some_keypair_rsa = artifactory.Keypair("some-keypairRSA", + pair_name="some-keypair", + pair_type="RSA", + alias="foo-alias", + private_key=std.file(input="samples/rsa.priv").result, + public_key=std.file(input="samples/rsa.pub").result) + terraform_local_test_alpine_repo_basic = artifactory.AlpineRepository("terraform-local-test-alpine-repo-basic", + key="terraform-local-test-alpine-repo-basic", + primary_keypair_ref=some_keypair_rsa.pair_name, + opts=pulumi.ResourceOptions(depends_on=[some_keypair_rsa])) + ``` + + ## Import Local repositories can be imported using their name, e.g. diff --git a/sdk/python/pulumi_artifactory/certificate.py b/sdk/python/pulumi_artifactory/certificate.py index 4e31d69b..d14ce49c 100644 --- a/sdk/python/pulumi_artifactory/certificate.py +++ b/sdk/python/pulumi_artifactory/certificate.py @@ -214,6 +214,23 @@ def __init__(__self__, """ Provides an Artifactory certificate resource. This can be used to create and manage Artifactory certificates which can be used as client authentication against remote repositories. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + # Create a new Artifactory certificate called my-cert + my_cert = artifactory.Certificate("my-cert", + alias="my-cert", + content=std.file(input="/path/to/bundle.pem").result) + # This can then be used by a remote repository + my_remote = artifactory.RemoteMavenRepository("my-remote", client_tls_certificate=my_cert.alias) + ``` + + ## Import Certificates can be imported using their alias, e.g. @@ -237,6 +254,23 @@ def __init__(__self__, """ Provides an Artifactory certificate resource. This can be used to create and manage Artifactory certificates which can be used as client authentication against remote repositories. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + # Create a new Artifactory certificate called my-cert + my_cert = artifactory.Certificate("my-cert", + alias="my-cert", + content=std.file(input="/path/to/bundle.pem").result) + # This can then be used by a remote repository + my_remote = artifactory.RemoteMavenRepository("my-remote", client_tls_certificate=my_cert.alias) + ``` + + ## Import Certificates can be imported using their alias, e.g. diff --git a/sdk/python/pulumi_artifactory/debian_repository.py b/sdk/python/pulumi_artifactory/debian_repository.py index 99c6325d..dbf9e9b8 100644 --- a/sdk/python/pulumi_artifactory/debian_repository.py +++ b/sdk/python/pulumi_artifactory/debian_repository.py @@ -734,6 +734,43 @@ def __init__(__self__, """ Creates a local Debian repository and allows for the creation of a GPG key. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + some_keypair_gpg1 = artifactory.Keypair("some-keypairGPG1", + pair_name=f"some-keypair{randid['id']}", + pair_type="GPG", + alias="foo-alias1", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + some_keypair_gpg2 = artifactory.Keypair("some-keypairGPG2", + pair_name=f"some-keypair4{randid['id']}", + pair_type="GPG", + alias="foo-alias2", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + my_debian_repo = artifactory.DebianRepository("my-debian-repo", + key="my-debian-repo", + primary_keypair_ref=some_keypair_gpg1.pair_name, + secondary_keypair_ref=some_keypair_gpg2.pair_name, + index_compression_formats=[ + "bz2", + "lzma", + "xz", + ], + trivial_layout=True, + opts=pulumi.ResourceOptions(depends_on=[ + some_keypair_gpg1, + some_keypair_gpg2, + ])) + ``` + + ## Import Local repositories can be imported using their name, e.g. @@ -785,6 +822,43 @@ def __init__(__self__, """ Creates a local Debian repository and allows for the creation of a GPG key. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + some_keypair_gpg1 = artifactory.Keypair("some-keypairGPG1", + pair_name=f"some-keypair{randid['id']}", + pair_type="GPG", + alias="foo-alias1", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + some_keypair_gpg2 = artifactory.Keypair("some-keypairGPG2", + pair_name=f"some-keypair4{randid['id']}", + pair_type="GPG", + alias="foo-alias2", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + my_debian_repo = artifactory.DebianRepository("my-debian-repo", + key="my-debian-repo", + primary_keypair_ref=some_keypair_gpg1.pair_name, + secondary_keypair_ref=some_keypair_gpg2.pair_name, + index_compression_formats=[ + "bz2", + "lzma", + "xz", + ], + trivial_layout=True, + opts=pulumi.ResourceOptions(depends_on=[ + some_keypair_gpg1, + some_keypair_gpg2, + ])) + ``` + + ## Import Local repositories can be imported using their name, e.g. diff --git a/sdk/python/pulumi_artifactory/distribution_public_key.py b/sdk/python/pulumi_artifactory/distribution_public_key.py index 239dbb84..1652fc22 100644 --- a/sdk/python/pulumi_artifactory/distribution_public_key.py +++ b/sdk/python/pulumi_artifactory/distribution_public_key.py @@ -190,6 +190,20 @@ def __init__(__self__, See [API description](https://jfrog.com/help/r/jfrog-rest-apis/set-distributionpublic-gpg-key) in the Artifactory documentation for more details. Also the [UI documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/managing-webstart-and-jar-signing) has further details on where to find these keys in Artifactory. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + my_key = artifactory.DistributionPublicKey("my-key", + alias="my-key", + public_key=std.file(input="samples/rsa.pub").result) + ``` + + ## Import Distribution Public Key can be imported using the key id, e.g. @@ -216,6 +230,20 @@ def __init__(__self__, See [API description](https://jfrog.com/help/r/jfrog-rest-apis/set-distributionpublic-gpg-key) in the Artifactory documentation for more details. Also the [UI documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/managing-webstart-and-jar-signing) has further details on where to find these keys in Artifactory. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + my_key = artifactory.DistributionPublicKey("my-key", + alias="my-key", + public_key=std.file(input="samples/rsa.pub").result) + ``` + + ## Import Distribution Public Key can be imported using the key id, e.g. diff --git a/sdk/python/pulumi_artifactory/keypair.py b/sdk/python/pulumi_artifactory/keypair.py index c98e5b6c..f032420e 100644 --- a/sdk/python/pulumi_artifactory/keypair.py +++ b/sdk/python/pulumi_artifactory/keypair.py @@ -238,6 +238,24 @@ def __init__(__self__, RSA key pairs are used to sign and verify the Alpine Linux index files in JFrog Artifactory, while GPG key pairs are used to sign and validate packages integrity in JFrog Distribution. The JFrog Platform enables you to manage multiple RSA and GPG signing keys through the Keys Management UI and REST API. The JFrog Platform supports managing multiple pairs of GPG signing keys to sign packages for authentication of several package types such as Debian, Opkg, and RPM through the Keys Management UI and REST API. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + some_keypair_6543461672124900137 = artifactory.Keypair("some-keypair-6543461672124900137", + pair_name="some-keypair-6543461672124900137", + pair_type="RSA", + alias="some-alias-6543461672124900137", + private_key=std.file(input="samples/rsa.priv").result, + public_key=std.file(input="samples/rsa.pub").result, + passphrase="PASSPHRASE") + ``` + + ## Import Keypair can be imported using the pair name, e.g. @@ -267,6 +285,24 @@ def __init__(__self__, RSA key pairs are used to sign and verify the Alpine Linux index files in JFrog Artifactory, while GPG key pairs are used to sign and validate packages integrity in JFrog Distribution. The JFrog Platform enables you to manage multiple RSA and GPG signing keys through the Keys Management UI and REST API. The JFrog Platform supports managing multiple pairs of GPG signing keys to sign packages for authentication of several package types such as Debian, Opkg, and RPM through the Keys Management UI and REST API. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + some_keypair_6543461672124900137 = artifactory.Keypair("some-keypair-6543461672124900137", + pair_name="some-keypair-6543461672124900137", + pair_type="RSA", + alias="some-alias-6543461672124900137", + private_key=std.file(input="samples/rsa.priv").result, + public_key=std.file(input="samples/rsa.pub").result, + passphrase="PASSPHRASE") + ``` + + ## Import Keypair can be imported using the pair name, e.g. diff --git a/sdk/python/pulumi_artifactory/local_rpm_repository.py b/sdk/python/pulumi_artifactory/local_rpm_repository.py index dc843253..11e21bc7 100644 --- a/sdk/python/pulumi_artifactory/local_rpm_repository.py +++ b/sdk/python/pulumi_artifactory/local_rpm_repository.py @@ -808,6 +808,41 @@ def __init__(__self__, """ Creates a local RPM repository. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + some_keypair_gpg_1 = artifactory.Keypair("some-keypair-gpg-1", + pair_name=f"some-keypair{randid['id']}", + pair_type="GPG", + alias="foo-alias1", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + some_keypair_gpg_2 = artifactory.Keypair("some-keypair-gpg-2", + pair_name=f"some-keypair{randid['id']}", + pair_type="GPG", + alias="foo-alias2", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + terraform_local_test_rpm_repo_basic = artifactory.LocalRpmRepository("terraform-local-test-rpm-repo-basic", + key="terraform-local-test-rpm-repo-basic", + yum_root_depth=5, + calculate_yum_metadata=True, + enable_file_lists_indexing=True, + yum_group_file_names="file-1.xml,file-2.xml", + primary_keypair_ref=some_keypair_gpg1["pairName"], + secondary_keypair_ref=some_keypair_gpg2["pairName"], + opts=pulumi.ResourceOptions(depends_on=[ + some_keypair_gpg_1, + some_keypair_gpg_2, + ])) + ``` + + ## Import Local repositories can be imported using their name, e.g. @@ -866,6 +901,41 @@ def __init__(__self__, """ Creates a local RPM repository. + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + some_keypair_gpg_1 = artifactory.Keypair("some-keypair-gpg-1", + pair_name=f"some-keypair{randid['id']}", + pair_type="GPG", + alias="foo-alias1", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + some_keypair_gpg_2 = artifactory.Keypair("some-keypair-gpg-2", + pair_name=f"some-keypair{randid['id']}", + pair_type="GPG", + alias="foo-alias2", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + terraform_local_test_rpm_repo_basic = artifactory.LocalRpmRepository("terraform-local-test-rpm-repo-basic", + key="terraform-local-test-rpm-repo-basic", + yum_root_depth=5, + calculate_yum_metadata=True, + enable_file_lists_indexing=True, + yum_group_file_names="file-1.xml,file-2.xml", + primary_keypair_ref=some_keypair_gpg1["pairName"], + secondary_keypair_ref=some_keypair_gpg2["pairName"], + opts=pulumi.ResourceOptions(depends_on=[ + some_keypair_gpg_1, + some_keypair_gpg_2, + ])) + ``` + + ## Import Local repositories can be imported using their name, e.g. diff --git a/sdk/python/pulumi_artifactory/virtual_rpm_repository.py b/sdk/python/pulumi_artifactory/virtual_rpm_repository.py index c751f00a..9fd81b5d 100644 --- a/sdk/python/pulumi_artifactory/virtual_rpm_repository.py +++ b/sdk/python/pulumi_artifactory/virtual_rpm_repository.py @@ -509,6 +509,37 @@ def __init__(__self__, Creates a virtual Rpm repository. Official documentation can be found [here](https://www.jfrog.com/confluence/display/JFROG/RPM+Repositories). + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + primary_keypair = artifactory.Keypair("primary-keypair", + pair_name="primary-keypair", + pair_type="GPG", + alias="foo-alias-1", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + secondary_keypair = artifactory.Keypair("secondary-keypair", + pair_name="secondary-keypair", + pair_type="GPG", + alias="foo-alias-2", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + foo_rpm_virtual = artifactory.VirtualRpmRepository("foo-rpm-virtual", + key="foo-rpm-virtual", + primary_keypair_ref=primary_keypair.pair_name, + secondary_keypair_ref=secondary_keypair.pair_name, + opts=pulumi.ResourceOptions(depends_on=[ + primary_keypair, + secondary_keypair, + ])) + ``` + + ## Import Virtual repositories can be imported using their name, e.g. @@ -551,6 +582,37 @@ def __init__(__self__, Creates a virtual Rpm repository. Official documentation can be found [here](https://www.jfrog.com/confluence/display/JFROG/RPM+Repositories). + ## Example Usage + + + ```python + import pulumi + import pulumi_artifactory as artifactory + import pulumi_std as std + + primary_keypair = artifactory.Keypair("primary-keypair", + pair_name="primary-keypair", + pair_type="GPG", + alias="foo-alias-1", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + secondary_keypair = artifactory.Keypair("secondary-keypair", + pair_name="secondary-keypair", + pair_type="GPG", + alias="foo-alias-2", + private_key=std.file(input="samples/gpg.priv").result, + public_key=std.file(input="samples/gpg.pub").result) + foo_rpm_virtual = artifactory.VirtualRpmRepository("foo-rpm-virtual", + key="foo-rpm-virtual", + primary_keypair_ref=primary_keypair.pair_name, + secondary_keypair_ref=secondary_keypair.pair_name, + opts=pulumi.ResourceOptions(depends_on=[ + primary_keypair, + secondary_keypair, + ])) + ``` + + ## Import Virtual repositories can be imported using their name, e.g.