@cdktf/provider-google
Version:
Prebuilt google Provider for Terraform CDK (cdktf)
1,166 lines (1,165 loc) • 184 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecretManagerSecret = exports.SecretManagerSecretTopicsList = exports.SecretManagerSecretTopicsOutputReference = exports.SecretManagerSecretTimeoutsOutputReference = exports.SecretManagerSecretRotationOutputReference = exports.SecretManagerSecretReplicationOutputReference = exports.SecretManagerSecretReplicationUserManagedOutputReference = exports.SecretManagerSecretReplicationUserManagedReplicasList = exports.SecretManagerSecretReplicationUserManagedReplicasOutputReference = exports.SecretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionOutputReference = exports.SecretManagerSecretReplicationAutoOutputReference = exports.SecretManagerSecretReplicationAutoCustomerManagedEncryptionOutputReference = void 0;
exports.secretManagerSecretReplicationAutoCustomerManagedEncryptionToTerraform = secretManagerSecretReplicationAutoCustomerManagedEncryptionToTerraform;
exports.secretManagerSecretReplicationAutoCustomerManagedEncryptionToHclTerraform = secretManagerSecretReplicationAutoCustomerManagedEncryptionToHclTerraform;
exports.secretManagerSecretReplicationAutoToTerraform = secretManagerSecretReplicationAutoToTerraform;
exports.secretManagerSecretReplicationAutoToHclTerraform = secretManagerSecretReplicationAutoToHclTerraform;
exports.secretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionToTerraform = secretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionToTerraform;
exports.secretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionToHclTerraform = secretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionToHclTerraform;
exports.secretManagerSecretReplicationUserManagedReplicasToTerraform = secretManagerSecretReplicationUserManagedReplicasToTerraform;
exports.secretManagerSecretReplicationUserManagedReplicasToHclTerraform = secretManagerSecretReplicationUserManagedReplicasToHclTerraform;
exports.secretManagerSecretReplicationUserManagedToTerraform = secretManagerSecretReplicationUserManagedToTerraform;
exports.secretManagerSecretReplicationUserManagedToHclTerraform = secretManagerSecretReplicationUserManagedToHclTerraform;
exports.secretManagerSecretReplicationToTerraform = secretManagerSecretReplicationToTerraform;
exports.secretManagerSecretReplicationToHclTerraform = secretManagerSecretReplicationToHclTerraform;
exports.secretManagerSecretRotationToTerraform = secretManagerSecretRotationToTerraform;
exports.secretManagerSecretRotationToHclTerraform = secretManagerSecretRotationToHclTerraform;
exports.secretManagerSecretTimeoutsToTerraform = secretManagerSecretTimeoutsToTerraform;
exports.secretManagerSecretTimeoutsToHclTerraform = secretManagerSecretTimeoutsToHclTerraform;
exports.secretManagerSecretTopicsToTerraform = secretManagerSecretTopicsToTerraform;
exports.secretManagerSecretTopicsToHclTerraform = secretManagerSecretTopicsToHclTerraform;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function secretManagerSecretReplicationAutoCustomerManagedEncryptionToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
kms_key_name: cdktf.stringToTerraform(struct.kmsKeyName),
};
}
function secretManagerSecretReplicationAutoCustomerManagedEncryptionToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
kms_key_name: {
value: cdktf.stringToHclTerraform(struct.kmsKeyName),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretReplicationAutoCustomerManagedEncryptionOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._kmsKeyName !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeyName = this._kmsKeyName;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._kmsKeyName = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._kmsKeyName = value.kmsKeyName;
}
}
get kmsKeyName() {
return this.getStringAttribute('kms_key_name');
}
set kmsKeyName(value) {
this._kmsKeyName = value;
}
// Temporarily expose input value. Use with caution.
get kmsKeyNameInput() {
return this._kmsKeyName;
}
}
exports.SecretManagerSecretReplicationAutoCustomerManagedEncryptionOutputReference = SecretManagerSecretReplicationAutoCustomerManagedEncryptionOutputReference;
_a = JSII_RTTI_SYMBOL_1;
SecretManagerSecretReplicationAutoCustomerManagedEncryptionOutputReference[_a] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretReplicationAutoCustomerManagedEncryptionOutputReference", version: "14.35.0" };
function secretManagerSecretReplicationAutoToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
customer_managed_encryption: secretManagerSecretReplicationAutoCustomerManagedEncryptionToTerraform(struct.customerManagedEncryption),
};
}
function secretManagerSecretReplicationAutoToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
customer_managed_encryption: {
value: secretManagerSecretReplicationAutoCustomerManagedEncryptionToHclTerraform(struct.customerManagedEncryption),
isBlock: true,
type: "list",
storageClassType: "SecretManagerSecretReplicationAutoCustomerManagedEncryptionList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretReplicationAutoOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
// customer_managed_encryption - computed: false, optional: true, required: false
this._customerManagedEncryption = new SecretManagerSecretReplicationAutoCustomerManagedEncryptionOutputReference(this, "customer_managed_encryption");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._customerManagedEncryption?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.customerManagedEncryption = this._customerManagedEncryption?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._customerManagedEncryption.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._customerManagedEncryption.internalValue = value.customerManagedEncryption;
}
}
get customerManagedEncryption() {
return this._customerManagedEncryption;
}
putCustomerManagedEncryption(value) {
this._customerManagedEncryption.internalValue = value;
}
resetCustomerManagedEncryption() {
this._customerManagedEncryption.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get customerManagedEncryptionInput() {
return this._customerManagedEncryption.internalValue;
}
}
exports.SecretManagerSecretReplicationAutoOutputReference = SecretManagerSecretReplicationAutoOutputReference;
_b = JSII_RTTI_SYMBOL_1;
SecretManagerSecretReplicationAutoOutputReference[_b] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretReplicationAutoOutputReference", version: "14.35.0" };
function secretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
kms_key_name: cdktf.stringToTerraform(struct.kmsKeyName),
};
}
function secretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
kms_key_name: {
value: cdktf.stringToHclTerraform(struct.kmsKeyName),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._kmsKeyName !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeyName = this._kmsKeyName;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._kmsKeyName = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._kmsKeyName = value.kmsKeyName;
}
}
get kmsKeyName() {
return this.getStringAttribute('kms_key_name');
}
set kmsKeyName(value) {
this._kmsKeyName = value;
}
// Temporarily expose input value. Use with caution.
get kmsKeyNameInput() {
return this._kmsKeyName;
}
}
exports.SecretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionOutputReference = SecretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionOutputReference;
_c = JSII_RTTI_SYMBOL_1;
SecretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionOutputReference[_c] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionOutputReference", version: "14.35.0" };
function secretManagerSecretReplicationUserManagedReplicasToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
location: cdktf.stringToTerraform(struct.location),
customer_managed_encryption: secretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionToTerraform(struct.customerManagedEncryption),
};
}
function secretManagerSecretReplicationUserManagedReplicasToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
location: {
value: cdktf.stringToHclTerraform(struct.location),
isBlock: false,
type: "simple",
storageClassType: "string",
},
customer_managed_encryption: {
value: secretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionToHclTerraform(struct.customerManagedEncryption),
isBlock: true,
type: "list",
storageClassType: "SecretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretReplicationUserManagedReplicasOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param complexObjectIndex the index of this item in the list
* @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) {
super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex);
this.isEmptyObject = false;
// customer_managed_encryption - computed: false, optional: true, required: false
this._customerManagedEncryption = new SecretManagerSecretReplicationUserManagedReplicasCustomerManagedEncryptionOutputReference(this, "customer_managed_encryption");
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._location !== undefined) {
hasAnyValues = true;
internalValueResult.location = this._location;
}
if (this._customerManagedEncryption?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.customerManagedEncryption = this._customerManagedEncryption?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._location = undefined;
this._customerManagedEncryption.internalValue = undefined;
}
else if (cdktf.Tokenization.isResolvable(value)) {
this.isEmptyObject = false;
this.resolvableValue = value;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this.resolvableValue = undefined;
this._location = value.location;
this._customerManagedEncryption.internalValue = value.customerManagedEncryption;
}
}
get location() {
return this.getStringAttribute('location');
}
set location(value) {
this._location = value;
}
// Temporarily expose input value. Use with caution.
get locationInput() {
return this._location;
}
get customerManagedEncryption() {
return this._customerManagedEncryption;
}
putCustomerManagedEncryption(value) {
this._customerManagedEncryption.internalValue = value;
}
resetCustomerManagedEncryption() {
this._customerManagedEncryption.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get customerManagedEncryptionInput() {
return this._customerManagedEncryption.internalValue;
}
}
exports.SecretManagerSecretReplicationUserManagedReplicasOutputReference = SecretManagerSecretReplicationUserManagedReplicasOutputReference;
_d = JSII_RTTI_SYMBOL_1;
SecretManagerSecretReplicationUserManagedReplicasOutputReference[_d] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretReplicationUserManagedReplicasOutputReference", version: "14.35.0" };
class SecretManagerSecretReplicationUserManagedReplicasList extends cdktf.ComplexList {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, wrapsSet) {
super(terraformResource, terraformAttribute, wrapsSet);
this.terraformResource = terraformResource;
this.terraformAttribute = terraformAttribute;
this.wrapsSet = wrapsSet;
}
/**
* @param index the index of the item to return
*/
get(index) {
return new SecretManagerSecretReplicationUserManagedReplicasOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.SecretManagerSecretReplicationUserManagedReplicasList = SecretManagerSecretReplicationUserManagedReplicasList;
_e = JSII_RTTI_SYMBOL_1;
SecretManagerSecretReplicationUserManagedReplicasList[_e] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretReplicationUserManagedReplicasList", version: "14.35.0" };
function secretManagerSecretReplicationUserManagedToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
replicas: cdktf.listMapper(secretManagerSecretReplicationUserManagedReplicasToTerraform, true)(struct.replicas),
};
}
function secretManagerSecretReplicationUserManagedToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
replicas: {
value: cdktf.listMapperHcl(secretManagerSecretReplicationUserManagedReplicasToHclTerraform, true)(struct.replicas),
isBlock: true,
type: "list",
storageClassType: "SecretManagerSecretReplicationUserManagedReplicasList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretReplicationUserManagedOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
// replicas - computed: false, optional: false, required: true
this._replicas = new SecretManagerSecretReplicationUserManagedReplicasList(this, "replicas", false);
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._replicas?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.replicas = this._replicas?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._replicas.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._replicas.internalValue = value.replicas;
}
}
get replicas() {
return this._replicas;
}
putReplicas(value) {
this._replicas.internalValue = value;
}
// Temporarily expose input value. Use with caution.
get replicasInput() {
return this._replicas.internalValue;
}
}
exports.SecretManagerSecretReplicationUserManagedOutputReference = SecretManagerSecretReplicationUserManagedOutputReference;
_f = JSII_RTTI_SYMBOL_1;
SecretManagerSecretReplicationUserManagedOutputReference[_f] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretReplicationUserManagedOutputReference", version: "14.35.0" };
function secretManagerSecretReplicationToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
auto: secretManagerSecretReplicationAutoToTerraform(struct.auto),
user_managed: secretManagerSecretReplicationUserManagedToTerraform(struct.userManaged),
};
}
function secretManagerSecretReplicationToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
auto: {
value: secretManagerSecretReplicationAutoToHclTerraform(struct.auto),
isBlock: true,
type: "list",
storageClassType: "SecretManagerSecretReplicationAutoList",
},
user_managed: {
value: secretManagerSecretReplicationUserManagedToHclTerraform(struct.userManaged),
isBlock: true,
type: "list",
storageClassType: "SecretManagerSecretReplicationUserManagedList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretReplicationOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
// auto - computed: false, optional: true, required: false
this._auto = new SecretManagerSecretReplicationAutoOutputReference(this, "auto");
// user_managed - computed: false, optional: true, required: false
this._userManaged = new SecretManagerSecretReplicationUserManagedOutputReference(this, "user_managed");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._auto?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.auto = this._auto?.internalValue;
}
if (this._userManaged?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.userManaged = this._userManaged?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._auto.internalValue = undefined;
this._userManaged.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._auto.internalValue = value.auto;
this._userManaged.internalValue = value.userManaged;
}
}
get auto() {
return this._auto;
}
putAuto(value) {
this._auto.internalValue = value;
}
resetAuto() {
this._auto.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get autoInput() {
return this._auto.internalValue;
}
get userManaged() {
return this._userManaged;
}
putUserManaged(value) {
this._userManaged.internalValue = value;
}
resetUserManaged() {
this._userManaged.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get userManagedInput() {
return this._userManaged.internalValue;
}
}
exports.SecretManagerSecretReplicationOutputReference = SecretManagerSecretReplicationOutputReference;
_g = JSII_RTTI_SYMBOL_1;
SecretManagerSecretReplicationOutputReference[_g] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretReplicationOutputReference", version: "14.35.0" };
function secretManagerSecretRotationToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
next_rotation_time: cdktf.stringToTerraform(struct.nextRotationTime),
rotation_period: cdktf.stringToTerraform(struct.rotationPeriod),
};
}
function secretManagerSecretRotationToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
next_rotation_time: {
value: cdktf.stringToHclTerraform(struct.nextRotationTime),
isBlock: false,
type: "simple",
storageClassType: "string",
},
rotation_period: {
value: cdktf.stringToHclTerraform(struct.rotationPeriod),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretRotationOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._nextRotationTime !== undefined) {
hasAnyValues = true;
internalValueResult.nextRotationTime = this._nextRotationTime;
}
if (this._rotationPeriod !== undefined) {
hasAnyValues = true;
internalValueResult.rotationPeriod = this._rotationPeriod;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._nextRotationTime = undefined;
this._rotationPeriod = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._nextRotationTime = value.nextRotationTime;
this._rotationPeriod = value.rotationPeriod;
}
}
get nextRotationTime() {
return this.getStringAttribute('next_rotation_time');
}
set nextRotationTime(value) {
this._nextRotationTime = value;
}
resetNextRotationTime() {
this._nextRotationTime = undefined;
}
// Temporarily expose input value. Use with caution.
get nextRotationTimeInput() {
return this._nextRotationTime;
}
get rotationPeriod() {
return this.getStringAttribute('rotation_period');
}
set rotationPeriod(value) {
this._rotationPeriod = value;
}
resetRotationPeriod() {
this._rotationPeriod = undefined;
}
// Temporarily expose input value. Use with caution.
get rotationPeriodInput() {
return this._rotationPeriod;
}
}
exports.SecretManagerSecretRotationOutputReference = SecretManagerSecretRotationOutputReference;
_h = JSII_RTTI_SYMBOL_1;
SecretManagerSecretRotationOutputReference[_h] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretRotationOutputReference", version: "14.35.0" };
function secretManagerSecretTimeoutsToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
create: cdktf.stringToTerraform(struct.create),
delete: cdktf.stringToTerraform(struct.delete),
update: cdktf.stringToTerraform(struct.update),
};
}
function secretManagerSecretTimeoutsToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
create: {
value: cdktf.stringToHclTerraform(struct.create),
isBlock: false,
type: "simple",
storageClassType: "string",
},
delete: {
value: cdktf.stringToHclTerraform(struct.delete),
isBlock: false,
type: "simple",
storageClassType: "string",
},
update: {
value: cdktf.stringToHclTerraform(struct.update),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretTimeoutsOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false);
this.isEmptyObject = false;
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._create !== undefined) {
hasAnyValues = true;
internalValueResult.create = this._create;
}
if (this._delete !== undefined) {
hasAnyValues = true;
internalValueResult.delete = this._delete;
}
if (this._update !== undefined) {
hasAnyValues = true;
internalValueResult.update = this._update;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._create = undefined;
this._delete = undefined;
this._update = undefined;
}
else if (cdktf.Tokenization.isResolvable(value)) {
this.isEmptyObject = false;
this.resolvableValue = value;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this.resolvableValue = undefined;
this._create = value.create;
this._delete = value.delete;
this._update = value.update;
}
}
get create() {
return this.getStringAttribute('create');
}
set create(value) {
this._create = value;
}
resetCreate() {
this._create = undefined;
}
// Temporarily expose input value. Use with caution.
get createInput() {
return this._create;
}
get delete() {
return this.getStringAttribute('delete');
}
set delete(value) {
this._delete = value;
}
resetDelete() {
this._delete = undefined;
}
// Temporarily expose input value. Use with caution.
get deleteInput() {
return this._delete;
}
get update() {
return this.getStringAttribute('update');
}
set update(value) {
this._update = value;
}
resetUpdate() {
this._update = undefined;
}
// Temporarily expose input value. Use with caution.
get updateInput() {
return this._update;
}
}
exports.SecretManagerSecretTimeoutsOutputReference = SecretManagerSecretTimeoutsOutputReference;
_j = JSII_RTTI_SYMBOL_1;
SecretManagerSecretTimeoutsOutputReference[_j] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretTimeoutsOutputReference", version: "14.35.0" };
function secretManagerSecretTopicsToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
name: cdktf.stringToTerraform(struct.name),
};
}
function secretManagerSecretTopicsToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
name: {
value: cdktf.stringToHclTerraform(struct.name),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class SecretManagerSecretTopicsOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param complexObjectIndex the index of this item in the list
* @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) {
super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex);
this.isEmptyObject = false;
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._name !== undefined) {
hasAnyValues = true;
internalValueResult.name = this._name;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._name = undefined;
}
else if (cdktf.Tokenization.isResolvable(value)) {
this.isEmptyObject = false;
this.resolvableValue = value;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this.resolvableValue = undefined;
this._name = value.name;
}
}
get name() {
return this.getStringAttribute('name');
}
set name(value) {
this._name = value;
}
// Temporarily expose input value. Use with caution.
get nameInput() {
return this._name;
}
}
exports.SecretManagerSecretTopicsOutputReference = SecretManagerSecretTopicsOutputReference;
_k = JSII_RTTI_SYMBOL_1;
SecretManagerSecretTopicsOutputReference[_k] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretTopicsOutputReference", version: "14.35.0" };
class SecretManagerSecretTopicsList extends cdktf.ComplexList {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, wrapsSet) {
super(terraformResource, terraformAttribute, wrapsSet);
this.terraformResource = terraformResource;
this.terraformAttribute = terraformAttribute;
this.wrapsSet = wrapsSet;
}
/**
* @param index the index of the item to return
*/
get(index) {
return new SecretManagerSecretTopicsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.SecretManagerSecretTopicsList = SecretManagerSecretTopicsList;
_l = JSII_RTTI_SYMBOL_1;
SecretManagerSecretTopicsList[_l] = { fqn: "@cdktf/provider-google.secretManagerSecret.SecretManagerSecretTopicsList", version: "14.35.0" };
/**
* Represents a {@link https://registry.terraform.io/providers/hashicorp/google/6.36.0/docs/resources/secret_manager_secret google_secret_manager_secret}
*/
class SecretManagerSecret extends cdktf.TerraformResource {
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a SecretManagerSecret resource upon running "cdktf plan <stack-name>"
* @param scope The scope in which to define this construct
* @param importToId The construct id used in the generated config for the SecretManagerSecret to import
* @param importFromId The id of the existing SecretManagerSecret that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/google/6.36.0/docs/resources/secret_manager_secret#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the SecretManagerSecret to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "google_secret_manager_secret", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/hashicorp/google/6.36.0/docs/resources/secret_manager_secret google_secret_manager_secret} Resource
*
* @param scope The scope in which to define this construct
* @param id The scoped construct ID. Must be unique amongst siblings in the same scope
* @param options SecretManagerSecretConfig
*/
constructor(scope, id, config) {
super(scope, id, {
terraformResourceType: 'google_secret_manager_secret',
terraformGeneratorMetadata: {
providerName: 'google',
providerVersion: '6.36.0',
providerVersionConstraint: '~> 6.0'
},
provider: config.provider,
dependsOn: config.dependsOn,
count: config.count,
lifecycle: config.lifecycle,
provisioners: config.provisioners,
connection: config.connection,
forEach: config.forEach
});
// effective_annotations - computed: true, optional: false, required: false
this._effectiveAnnotations = new cdktf.StringMap(this, "effective_annotations");
// effective_labels - computed: true, optional: false, required: false
this._effectiveLabels = new cdktf.StringMap(this, "effective_labels");
// terraform_labels - computed: true, optional: false, required: false
this._terraformLabels = new cdktf.StringMap(this, "terraform_labels");
// replication - computed: false, optional: false, required: true
this._replication = new SecretManagerSecretReplicationOutputReference(this, "replication");
// rotation - computed: false, optional: true, required: false
this._rotation = new SecretManagerSecretRotationOutputReference(this, "rotation");
// timeouts - computed: false, optional: true, required: false
this._timeouts = new SecretManagerSecretTimeoutsOutputReference(this, "timeouts");
// topics - computed: false, optional: true, required: false
this._topics = new SecretManagerSecretTopicsList(this, "topics", false);
this._annotations = config.annotations;
this._expireTime = config.expireTime;
this._id = config.id;
this._labels = config.labels;
this._project = config.project;
this._secretId = config.secretId;
this._ttl = config.ttl;
this._versionAliases = config.versionAliases;
this._versionDestroyTtl = config.versionDestroyTtl;
this._replication.internalValue = config.replication;
this._rotation.internalValue = config.rotation;
this._timeouts.internalValue = config.timeouts;
this._topics.internalValue = config.topics;
}
get annotations() {
return this.getStringMapAttribute('annotations');
}
set annotations(value) {
this._annotations = value;
}
resetAnnotations() {
this._annotations = undefined;
}
// Temporarily expose input value. Use with caution.
get annotationsInput() {
return this._annotations;
}
// create_time - computed: true, optional: false, required: false
get createTime() {
return this.getStringAttribute('create_time');
}
get effectiveAnnotations() {
return this._effectiveAnnotations;
}
get effectiveLabels() {
return this._effectiveLabels;
}
get expireTime() {
return this.getStringAttribute('expire_time');
}
set expireTime(value) {
this._expireTime = value;
}
resetExpireTime() {
this._expireTime = undefined;
}
// Temporarily expose input value. Use with caution.
get expireTimeInput() {
return this._expireTime;
}
get id() {
return this.getStringAttribute('id');
}
set id(value) {
this._id = value;
}
resetId() {
this._id = undefined;
}
// Temporarily expose input value. Use with caution.
get idInput() {
return this._id;
}
get labels() {
return this.getStringMapAttribute('labels');
}
set labels(value) {
this._labels = value;
}
resetLabels() {
this._labels = undefined;
}
// Temporarily expose input value. Use with caution.
get labelsInput() {
return this._labels;
}
// name - computed: true, optional: false, required: false
get name() {
return this.getStringAttribute('name');
}
get project() {
return this.getStringAttribute('project');
}
set project(value) {
this._project = value;
}
resetProject() {
this._project = undefined;
}
// Temporarily expose input value. Use with caution.
get projectInput() {
return this._project;
}
get secretId() {
return this.getStringAttribute('secret_id');
}
set secretId(value) {
this._secretId = value;
}
// Temporarily expose input value. Use with caution.
get secretIdInput() {
return this._secretId;
}
get terraformLabels() {
return this._terraformLabels;
}
get ttl() {
return this.getStringAttribute('ttl');
}
set ttl(value) {
this._ttl = value;
}
resetTtl() {
this._ttl = undefined;
}
// Temporarily expose input value. Use with caution.
get ttlInput() {
return this._ttl;
}
get versionAliases() {
return this.getStringMapAttribute('version_aliases');
}
set versionAliases(value) {
this._versionAliases = value;
}
resetVersionAliases() {
this._versionAliases = undefined;
}
// Temporarily expose input value. Use with caution.
get versionAliasesInput() {
return this._versionAliases;
}
get versionDestroyTtl() {
return this.getStringAttribute('version_destroy_ttl');
}
set versionDestroyTtl(value) {
this._versionDestroyTtl = value;
}
resetVersionDestroyTtl() {
this._versionDestroyTtl = undefined;
}
// Temporarily expose input value. Use with caution.
get versionDestroyTtlInput() {
return this._versionDestroyTtl;
}
get replication() {
return this._replication;
}
putReplication(value) {
this._replication.internalValue = value;
}
// Temporarily expose input value. Use with caution.
get replicationInput() {
return this._replication.internalValue;
}
get rotation() {
return this._rotation;
}
putRotation(value) {
this._rotation.internalValue = value;
}
resetRotation() {
this._rotation.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get rotationInput() {
return this._rotation.internalValue;
}
get timeouts() {
return this._timeouts;
}
putTimeouts(value) {
this._timeouts.internalValue = value;
}
resetTimeouts() {
this._timeouts.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get timeoutsInput() {
return this._timeouts.internalValue;
}
get topics() {
return this._topics;
}
putTopics(value) {
this._topics.internalValue = value;
}
resetTopics() {
this._topics.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get topicsInput() {
return this._topics.internalValue;
}
// =========
// SYNTHESIS
// =========
synthesizeAttributes() {
return {
annotations: cdktf.hashMapper(cdktf.stringToTerraform)(this._annotations),
expire_time: cdktf.stringToTerraform(this._expireTime),
id: cdktf.stringToTerraform(this._id),
labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels),
project: cdktf.stringToTerraform(this._project),
secret_id: cdktf.stringToTerraform(this._secretId),
ttl: cdktf.stringToTerraform(this._ttl),
version_aliases: cdktf.hashMapper(cdktf.stringToTerraform)(this._versionAliases),
version_destroy_ttl: cdktf.stringToTerraform(this._versionDestroyTtl),
replication: secretManagerSecretReplicationToTerraform(this._replication.internalValue),
rotation: secretManagerSecretRotationToTerraform(this._rotation.internalValue),
timeouts: secretManagerSecretTimeoutsToTerraform(this._timeouts.internalValue),
topics: cdktf.listMapper(secretManagerSecretTopicsToTerraform, true)(this._topics.internalValue),
};
}
synthesizeHclAttributes() {
const attrs = {
annotations: {
value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._annotations),