« blib/lib/Paws/SecretsManager/CancelRotateSecretResponse.pm
↑ Summary
blib/lib/Paws/SecretsManager/CreateSecretResponse.pm »
| 1 | |||
| 2 | package Paws::SecretsManager::CreateSecret; | ||
| 3 | use Moose; | ||
| 4 | has AddReplicaRegions => (is => 'ro', isa => 'ArrayRef[Paws::SecretsManager::ReplicaRegionType]'); | ||
| 5 | has ClientRequestToken => (is => 'ro', isa => 'Str'); | ||
| 6 | has Description => (is => 'ro', isa => 'Str'); | ||
| 7 | has ForceOverwriteReplicaSecret => (is => 'ro', isa => 'Bool'); | ||
| 8 | has KmsKeyId => (is => 'ro', isa => 'Str'); | ||
| 9 | has Name => (is => 'ro', isa => 'Str', required => 1); | ||
| 10 | has SecretBinary => (is => 'ro', isa => 'Str'); | ||
| 11 | has SecretString => (is => 'ro', isa => 'Str'); | ||
| 12 | has Tags => (is => 'ro', isa => 'ArrayRef[Paws::SecretsManager::Tag]'); | ||
| 13 | |||
| 14 | use MooseX::ClassAttribute; | ||
| 15 | |||
| 16 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateSecret'); | ||
| 17 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SecretsManager::CreateSecretResponse'); | ||
| 18 | class_has _result_key => (isa => 'Str', is => 'ro'); | ||
| 19 | 1; | ||
| 20 | |||
| 21 | ### main pod documentation begin ### | ||
| 22 | |||
| 23 | =head1 NAME | ||
| 24 | |||
| 25 | Paws::SecretsManager::CreateSecret - Arguments for method CreateSecret on L<Paws::SecretsManager> | ||
| 26 | |||
| 27 | =head1 DESCRIPTION | ||
| 28 | |||
| 29 | This class represents the parameters used for calling the method CreateSecret on the | ||
| 30 | L<AWS Secrets Manager|Paws::SecretsManager> service. Use the attributes of this class | ||
| 31 | as arguments to method CreateSecret. | ||
| 32 | |||
| 33 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateSecret. | ||
| 34 | |||
| 35 | =head1 SYNOPSIS | ||
| 36 | |||
| 37 | my $secretsmanager = Paws->service('SecretsManager'); | ||
| 38 | # To create a basic secret | ||
| 39 | # The following example shows how to create a secret. The credentials stored in | ||
| 40 | # the encrypted secret value are retrieved from a file on disk named | ||
| 41 | # mycreds.json. | ||
| 42 | my $CreateSecretResponse = $secretsmanager->CreateSecret( | ||
| 43 | 'ClientRequestToken' => 'EXAMPLE1-90ab-cdef-fedc-ba987SECRET1', | ||
| 44 | 'Description' => 'My test database secret created with the CLI', | ||
| 45 | 'Name' => 'MyTestDatabaseSecret', | ||
| 46 | 'SecretString' => '{"username":"david","password":"BnQw!XDWgaEeT9XGTT29"}' | ||
| 47 | ); | ||
| 48 | |||
| 49 | # Results: | ||
| 50 | my $ARN = $CreateSecretResponse->ARN; | ||
| 51 | my $Name = $CreateSecretResponse->Name; | ||
| 52 | my $VersionId = $CreateSecretResponse->VersionId; | ||
| 53 | |||
| 54 | # Returns a L<Paws::SecretsManager::CreateSecretResponse> object. | ||
| 55 | |||
| 56 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 57 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/secretsmanager/CreateSecret> | ||
| 58 | |||
| 59 | =head1 ATTRIBUTES | ||
| 60 | |||
| 61 | |||
| 62 | =head2 AddReplicaRegions => ArrayRef[L<Paws::SecretsManager::ReplicaRegionType>] | ||
| 63 | |||
| 64 | (Optional) Add a list of regions to replicate secrets. Secrets Manager | ||
| 65 | replicates the KMSKeyID objects to the list of regions specified in the | ||
| 66 | parameter. | ||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | =head2 ClientRequestToken => Str | ||
| 71 | |||
| 72 | (Optional) If you include C<SecretString> or C<SecretBinary>, then an | ||
| 73 | initial version is created as part of the secret, and this parameter | ||
| 74 | specifies a unique identifier for the new version. | ||
| 75 | |||
| 76 | If you use the AWS CLI or one of the AWS SDK to call this operation, | ||
| 77 | then you can leave this parameter empty. The CLI or SDK generates a | ||
| 78 | random UUID for you and includes it as the value for this parameter in | ||
| 79 | the request. If you don't use the SDK and instead generate a raw HTTP | ||
| 80 | request to the Secrets Manager service endpoint, then you must generate | ||
| 81 | a C<ClientRequestToken> yourself for the new version and include the | ||
| 82 | value in the request. | ||
| 83 | |||
| 84 | This value helps ensure idempotency. Secrets Manager uses this value to | ||
| 85 | prevent the accidental creation of duplicate versions if there are | ||
| 86 | failures and retries during a rotation. We recommend that you generate | ||
| 87 | a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) | ||
| 88 | value to ensure uniqueness of your versions within the specified | ||
| 89 | secret. | ||
| 90 | |||
| 91 | =over | ||
| 92 | |||
| 93 | =item * | ||
| 94 | |||
| 95 | If the C<ClientRequestToken> value isn't already associated with a | ||
| 96 | version of the secret then a new version of the secret is created. | ||
| 97 | |||
| 98 | =item * | ||
| 99 | |||
| 100 | If a version with this value already exists and the version | ||
| 101 | C<SecretString> and C<SecretBinary> values are the same as those in the | ||
| 102 | request, then the request is ignored. | ||
| 103 | |||
| 104 | =item * | ||
| 105 | |||
| 106 | If a version with this value already exists and that version's | ||
| 107 | C<SecretString> and C<SecretBinary> values are different from those in | ||
| 108 | the request, then the request fails because you cannot modify an | ||
| 109 | existing version. Instead, use PutSecretValue to create a new version. | ||
| 110 | |||
| 111 | =back | ||
| 112 | |||
| 113 | This value becomes the C<VersionId> of the new version. | ||
| 114 | |||
| 115 | |||
| 116 | |||
| 117 | =head2 Description => Str | ||
| 118 | |||
| 119 | (Optional) Specifies a user-provided description of the secret. | ||
| 120 | |||
| 121 | |||
| 122 | |||
| 123 | =head2 ForceOverwriteReplicaSecret => Bool | ||
| 124 | |||
| 125 | (Optional) If set, the replication overwrites a secret with the same | ||
| 126 | name in the destination region. | ||
| 127 | |||
| 128 | |||
| 129 | |||
| 130 | =head2 KmsKeyId => Str | ||
| 131 | |||
| 132 | (Optional) Specifies the ARN, Key ID, or alias of the AWS KMS customer | ||
| 133 | master key (CMK) to be used to encrypt the C<SecretString> or | ||
| 134 | C<SecretBinary> values in the versions stored in this secret. | ||
| 135 | |||
| 136 | You can specify any of the supported ways to identify a AWS KMS key ID. | ||
| 137 | If you need to reference a CMK in a different account, you can use only | ||
| 138 | the key ARN or the alias ARN. | ||
| 139 | |||
| 140 | If you don't specify this value, then Secrets Manager defaults to using | ||
| 141 | the AWS account's default CMK (the one named C<aws/secretsmanager>). If | ||
| 142 | a AWS KMS CMK with that name doesn't yet exist, then Secrets Manager | ||
| 143 | creates it for you automatically the first time it needs to encrypt a | ||
| 144 | version's C<SecretString> or C<SecretBinary> fields. | ||
| 145 | |||
| 146 | You can use the account default CMK to encrypt and decrypt only if you | ||
| 147 | call this operation using credentials from the same account that owns | ||
| 148 | the secret. If the secret resides in a different account, then you must | ||
| 149 | create a custom CMK and specify the ARN in this field. | ||
| 150 | |||
| 151 | |||
| 152 | |||
| 153 | =head2 B<REQUIRED> Name => Str | ||
| 154 | |||
| 155 | Specifies the friendly name of the new secret. | ||
| 156 | |||
| 157 | The secret name must be ASCII letters, digits, or the following | ||
| 158 | characters : /_+=.@- | ||
| 159 | |||
| 160 | Do not end your secret name with a hyphen followed by six characters. | ||
| 161 | If you do so, you risk confusion and unexpected results when searching | ||
| 162 | for a secret by partial ARN. Secrets Manager automatically adds a | ||
| 163 | hyphen and six random characters at the end of the ARN. | ||
| 164 | |||
| 165 | |||
| 166 | |||
| 167 | =head2 SecretBinary => Str | ||
| 168 | |||
| 169 | (Optional) Specifies binary data that you want to encrypt and store in | ||
| 170 | the new version of the secret. To use this parameter in the | ||
| 171 | command-line tools, we recommend that you store your binary data in a | ||
| 172 | file and then use the appropriate technique for your tool to pass the | ||
| 173 | contents of the file as a parameter. | ||
| 174 | |||
| 175 | Either C<SecretString> or C<SecretBinary> must have a value, but not | ||
| 176 | both. They cannot both be empty. | ||
| 177 | |||
| 178 | This parameter is not available using the Secrets Manager console. It | ||
| 179 | can be accessed only by using the AWS CLI or one of the AWS SDKs. | ||
| 180 | |||
| 181 | |||
| 182 | |||
| 183 | =head2 SecretString => Str | ||
| 184 | |||
| 185 | (Optional) Specifies text data that you want to encrypt and store in | ||
| 186 | this new version of the secret. | ||
| 187 | |||
| 188 | Either C<SecretString> or C<SecretBinary> must have a value, but not | ||
| 189 | both. They cannot both be empty. | ||
| 190 | |||
| 191 | If you create a secret by using the Secrets Manager console then | ||
| 192 | Secrets Manager puts the protected secret text in only the | ||
| 193 | C<SecretString> parameter. The Secrets Manager console stores the | ||
| 194 | information as a JSON structure of key/value pairs that the Lambda | ||
| 195 | rotation function knows how to parse. | ||
| 196 | |||
| 197 | For storing multiple values, we recommend that you use a JSON text | ||
| 198 | string argument and specify key/value pairs. For information on how to | ||
| 199 | format a JSON parameter for the various command line tool environments, | ||
| 200 | see Using JSON for Parameters | ||
| 201 | (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) | ||
| 202 | in the I<AWS CLI User Guide>. For example: | ||
| 203 | |||
| 204 | C<{"username":"bob","password":"abc123xyz456"}> | ||
| 205 | |||
| 206 | If your command-line tool or SDK requires quotation marks around the | ||
| 207 | parameter, you should use single quotes to avoid confusion with the | ||
| 208 | double quotes required in the JSON text. | ||
| 209 | |||
| 210 | |||
| 211 | |||
| 212 | =head2 Tags => ArrayRef[L<Paws::SecretsManager::Tag>] | ||
| 213 | |||
| 214 | (Optional) Specifies a list of user-defined tags that are attached to | ||
| 215 | the secret. Each tag is a "Key" and "Value" pair of strings. This | ||
| 216 | operation only appends tags to the existing list of tags. To remove | ||
| 217 | tags, you must use UntagResource. | ||
| 218 | |||
| 219 | =over | ||
| 220 | |||
| 221 | =item * | ||
| 222 | |||
| 223 | Secrets Manager tag key names are case sensitive. A tag with the key | ||
| 224 | "ABC" is a different tag from one with key "abc". | ||
| 225 | |||
| 226 | =item * | ||
| 227 | |||
| 228 | If you check tags in IAM policy C<Condition> elements as part of your | ||
| 229 | security strategy, then adding or removing a tag can change | ||
| 230 | permissions. If the successful completion of this operation would | ||
| 231 | result in you losing your permissions for this secret, then this | ||
| 232 | operation is blocked and returns an C<Access Denied> error. | ||
| 233 | |||
| 234 | =back | ||
| 235 | |||
| 236 | This parameter requires a JSON text string argument. For information on | ||
| 237 | how to format a JSON parameter for the various command line tool | ||
| 238 | environments, see Using JSON for Parameters | ||
| 239 | (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) | ||
| 240 | in the I<AWS CLI User Guide>. For example: | ||
| 241 | |||
| 242 | C<[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}]> | ||
| 243 | |||
| 244 | If your command-line tool or SDK requires quotation marks around the | ||
| 245 | parameter, you should use single quotes to avoid confusion with the | ||
| 246 | double quotes required in the JSON text. | ||
| 247 | |||
| 248 | The following basic restrictions apply to tags: | ||
| 249 | |||
| 250 | =over | ||
| 251 | |||
| 252 | =item * | ||
| 253 | |||
| 254 | Maximum number of tags per secretE<mdash>50 | ||
| 255 | |||
| 256 | =item * | ||
| 257 | |||
| 258 | Maximum key lengthE<mdash>127 Unicode characters in UTF-8 | ||
| 259 | |||
| 260 | =item * | ||
| 261 | |||
| 262 | Maximum value lengthE<mdash>255 Unicode characters in UTF-8 | ||
| 263 | |||
| 264 | =item * | ||
| 265 | |||
| 266 | Tag keys and values are case sensitive. | ||
| 267 | |||
| 268 | =item * | ||
| 269 | |||
| 270 | Do not use the C<aws:> prefix in your tag names or values because AWS | ||
| 271 | reserves it for AWS use. You can't edit or delete tag names or values | ||
| 272 | with this prefix. Tags with this prefix do not count against your tags | ||
| 273 | per secret limit. | ||
| 274 | |||
| 275 | =item * | ||
| 276 | |||
| 277 | If you use your tagging schema across multiple services and resources, | ||
| 278 | remember other services might have restrictions on allowed characters. | ||
| 279 | Generally allowed characters: letters, spaces, and numbers | ||
| 280 | representable in UTF-8, plus the following special characters: + - = . | ||
| 281 | _ : / @. | ||
| 282 | |||
| 283 | =back | ||
| 284 | |||
| 285 | |||
| 286 | |||
| 287 | |||
| 288 | |||
| 289 | =head1 SEE ALSO | ||
| 290 | |||
| 291 | This class forms part of L<Paws>, documenting arguments for method CreateSecret in L<Paws::SecretsManager> | ||
| 292 | |||
| 293 | =head1 BUGS and CONTRIBUTIONS | ||
| 294 | |||
| 295 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 296 | |||
| 297 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 298 | |||
| 299 | =cut | ||
| 300 |