Secret Sync
The SecretSync resource. Uses Azure REST API version 2024-08-21-preview. In version 2.x of the Azure Native provider, it used API version 2024-08-21-preview.
Example Usage
SecretSyncs_CreateOrUpdate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var secretSync = new AzureNative.SecretSyncController.SecretSync("secretSync", new()
{
ExtendedLocation = new AzureNative.SecretSyncController.Inputs.AzureResourceManagerCommonTypesExtendedLocationArgs
{
Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-ssc-example/providers/Microsoft.ExtendedLocation/customLocations/example-custom-location",
Type = AzureNative.SecretSyncController.ExtendedLocationType.CustomLocation,
},
KubernetesSecretType = AzureNative.SecretSyncController.KubernetesSecretType.Opaque,
Location = "eastus",
ObjectSecretMapping = new[]
{
new AzureNative.SecretSyncController.Inputs.KubernetesSecretObjectMappingArgs
{
SourcePath = "kv-secret-name/0",
TargetKey = "kv-secret-name/0",
},
},
ResourceGroupName = "rg-ssc-example",
SecretProviderClassName = "akvspc-ssc-example",
SecretSyncName = "secretsync-ssc-example",
ServiceAccountName = "example-k8s-sa-name",
Tags =
{
{ "example-tag", "example-tag-value" },
},
});
});
package main
import (
secretsynccontroller "github.com/pulumi/pulumi-azure-native-sdk/secretsynccontroller/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := secretsynccontroller.NewSecretSync(ctx, "secretSync", &secretsynccontroller.SecretSyncArgs{
ExtendedLocation: &secretsynccontroller.AzureResourceManagerCommonTypesExtendedLocationArgs{
Name: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-ssc-example/providers/Microsoft.ExtendedLocation/customLocations/example-custom-location"),
Type: pulumi.String(secretsynccontroller.ExtendedLocationTypeCustomLocation),
},
KubernetesSecretType: pulumi.String(secretsynccontroller.KubernetesSecretTypeOpaque),
Location: pulumi.String("eastus"),
ObjectSecretMapping: secretsynccontroller.KubernetesSecretObjectMappingArray{
&secretsynccontroller.KubernetesSecretObjectMappingArgs{
SourcePath: pulumi.String("kv-secret-name/0"),
TargetKey: pulumi.String("kv-secret-name/0"),
},
},
ResourceGroupName: pulumi.String("rg-ssc-example"),
SecretProviderClassName: pulumi.String("akvspc-ssc-example"),
SecretSyncName: pulumi.String("secretsync-ssc-example"),
ServiceAccountName: pulumi.String("example-k8s-sa-name"),
Tags: pulumi.StringMap{
"example-tag": pulumi.String("example-tag-value"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.secretsynccontroller.SecretSync;
import com.pulumi.azurenative.secretsynccontroller.SecretSyncArgs;
import com.pulumi.azurenative.secretsynccontroller.inputs.AzureResourceManagerCommonTypesExtendedLocationArgs;
import com.pulumi.azurenative.secretsynccontroller.inputs.KubernetesSecretObjectMappingArgs;
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 secretSync = new SecretSync("secretSync", SecretSyncArgs.builder()
.extendedLocation(AzureResourceManagerCommonTypesExtendedLocationArgs.builder()
.name("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-ssc-example/providers/Microsoft.ExtendedLocation/customLocations/example-custom-location")
.type("CustomLocation")
.build())
.kubernetesSecretType("Opaque")
.location("eastus")
.objectSecretMapping(KubernetesSecretObjectMappingArgs.builder()
.sourcePath("kv-secret-name/0")
.targetKey("kv-secret-name/0")
.build())
.resourceGroupName("rg-ssc-example")
.secretProviderClassName("akvspc-ssc-example")
.secretSyncName("secretsync-ssc-example")
.serviceAccountName("example-k8s-sa-name")
.tags(Map.of("example-tag", "example-tag-value"))
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:secretsynccontroller:SecretSync secretsync-ssc-example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecretSyncController/secretSyncs/{secretSyncName}
Properties
The Azure API version of the resource.
The complex type of the extended location.
ForceSynchronization can be used to force the secret synchronization. The secret synchronization is triggered by changing the value in this field. This field is not used to resolve synchronization conflicts.
Type specifies the type of the Kubernetes secret object, e.g. "Opaque" or"kubernetes.io/tls". The controller must have permission to create secrets of the specified type.
An array of SecretObjectData that maps secret data from the external secret provider to the Kubernetes secret. Each entry specifies the source secret in the external provider and the corresponding key in the Kubernetes secret.
Provisioning state of the SecretSync instance.
SecretProviderClassName specifies the name of the SecretProviderClass resource, which contains the information needed to access the cloud provider secret store.
ServiceAccountName specifies the name of the service account used to access the cloud provider secret store. The audience field in the service account token must be passed as parameter in the controller configuration. The audience is used when requesting a token from the API server for the service account; the supported audiences are defined by each provider.
SecretSyncStatus defines the observed state of the secret synchronization process.
Azure Resource Manager metadata containing createdBy and modifiedBy information.