Skip to content

Commit

Permalink
add not_after field to role endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rculpepper committed Jan 3, 2025
1 parent f1afba6 commit 10f696b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vault/resource_pki_secret_backend_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,13 @@ func pkiSecretBackendRoleResource() *schema.Resource {
Type: schema.TypeString,
},
},
consts.FieldNotAfter: {
Type: schema.TypeString,
Optional: true,
Description: "Set the Not After field of the certificate with specified date value. " +
"The value format should be given in UTC format YYYY-MM-ddTHH:MM:SSZ. Supports the " +
"Y10K end date for IEEE 802.1AR-2018 standard devices, 9999-12-31T23:59:59Z.",
},
},
}
}
Expand Down Expand Up @@ -505,6 +512,12 @@ func pkiSecretBackendRoleCreate(ctx context.Context, d *schema.ResourceData, met
data[consts.FieldPolicyIdentifiers] = pki.ReadPolicyIdentifierBlocks(policyIdentifierBlocksRaw.(*schema.Set))
}

if provider.IsAPISupported(meta, provider.VaultVersion110) {
if notAfter, ok := d.GetOk(consts.FieldNotAfter); ok {
data[consts.FieldNotAfter] = notAfter
}
}

if provider.IsAPISupported(meta, provider.VaultVersion111) {
if issuerRef, ok := d.GetOk(consts.FieldIssuerRef); ok {
data[consts.FieldIssuerRef] = issuerRef
Expand Down

0 comments on commit 10f696b

Please sign in to comment.