pulumi/pkg/codegen/internal/test/testdata/random.json
Ian Wahbe 9f6589ed8c
iwahbe/7802/compile program generator test output (#8036)
* Move program tests into folders

* update package schema

* Enabled tests pass

* Fix lints and begin to update test cases

* Re-enable tests

* Update aws version to v4

* Refactor language specific parts

* Hook up dotnet and nodejs

* Update tests from master

* SSOT for schema/version

* Name blocking errors. Leave tests in valid state

* Give each language its own folder

* Remove SkipCompile for azure-sa (bug was fixed)

* Fix nits + changes asserts to require

* Remove unused import

* One last assert => require
2021-09-29 11:33:57 -07:00

799 lines
51 KiB
JSON

{
"attribution": "This Pulumi package is based on the [`random` Terraform Provider](https://github.com/terraform-providers/terraform-provider-random).",
"config": {},
"description": "A Pulumi package to safely use randomness in Pulumi programs.",
"homepage": "https://pulumi.io",
"keywords": [
"pulumi",
"random"
],
"language": {
"csharp": {
"compatibility": "tfbridge20",
"namespaces": {
"random": "Random"
},
"packageReferences": {
"Pulumi": "3.*",
"System.Collections.Immutable": "1.6.0"
}
},
"go": {
"generateResourceContainerTypes": true,
"importBasePath": "github.com/pulumi/pulumi-random/sdk/v4/go/random"
},
"nodejs": {
"compatibility": "tfbridge20",
"dependencies": {
"@pulumi/pulumi": "^3.0.0"
},
"devDependencies": {
"@types/node": "^10.0.0"
},
"disableUnionOutputTypes": true,
"packageDescription": "A Pulumi package to safely use randomness in Pulumi programs.",
"packageName": "",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-random)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi/pulumi-random` repo](https://github.com/pulumi/pulumi-random/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-providers/terraform-provider-random` repo](https://github.com/terraform-providers/terraform-provider-random/issues).",
"typescriptVersion": ""
},
"python": {
"compatibility": "tfbridge20",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-random)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi/pulumi-random` repo](https://github.com/pulumi/pulumi-random/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-providers/terraform-provider-random` repo](https://github.com/terraform-providers/terraform-provider-random/issues).",
"requires": {
"pulumi": "\u003e=3.0.0,\u003c4.0.0"
}
}
},
"license": "Apache-2.0",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
},
"name": "random",
"provider": {
"description": "The provider type for the random package. By default, resources use package-wide configuration\nsettings, however an explicit `Provider` instance may be created and passed during resource\nconstruction to achieve fine-grained programmatic control over provider settings. See the\n[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.\n"
},
"repository": "https://github.com/pulumi/pulumi-random",
"resources": {
"random:index/randomId:RandomId": {
"description": "The resource `random.RandomId` generates random numbers that are intended to be\nused as unique identifiers for other resources.\n\nThis resource *does* use a cryptographic random number generator in order\nto minimize the chance of collisions, making the results of this resource\nwhen a 16-byte identifier is requested of equivalent uniqueness to a\ntype-4 UUID.\n\nThis resource can be used in conjunction with resources that have\nthe `create_before_destroy` lifecycle flag set to avoid conflicts with\nunique names during the brief period where both the old and new resources\nexist concurrently.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a unique name for an AWS EC2\n// instance that changes each time a new AMI id is selected.\nconst serverRandomId = new random.RandomId(\"serverRandomId\", {\n keepers: {\n ami_id: _var.ami_id,\n },\n byteLength: 8,\n});\nconst serverInstance = new aws.ec2.Instance(\"serverInstance\", {\n tags: {\n Name: pulumi.interpolate`web-server ${serverRandomId.hex}`,\n },\n ami: serverRandomId.keepers.amiId,\n});\n// ... (other aws_instance arguments) ...\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a unique name for an AWS EC2\n# instance that changes each time a new AMI id is selected.\nserver_random_id = random.RandomId(\"serverRandomId\",\n keepers={\n \"ami_id\": var[\"ami_id\"],\n },\n byte_length=8)\nserver_instance = aws.ec2.Instance(\"serverInstance\",\n tags={\n \"Name\": server_random_id.hex.apply(lambda hex: f\"web-server {hex}\"),\n },\n ami=server_random_id.keepers[\"amiId\"])\n# ... (other aws_instance arguments) ...\n```\n```csharp\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n // The following example shows how to generate a unique name for an AWS EC2\n // instance that changes each time a new AMI id is selected.\n var serverRandomId = new Random.RandomId(\"serverRandomId\", new Random.RandomIdArgs\n {\n Keepers = \n {\n { \"ami_id\", @var.Ami_id },\n },\n ByteLength = 8,\n });\n var serverInstance = new Aws.Ec2.Instance(\"serverInstance\", new Aws.Ec2.InstanceArgs\n {\n Tags = \n {\n { \"Name\", serverRandomId.Hex.Apply(hex =\u003e $\"web-server {hex}\") },\n },\n Ami = serverRandomId.Keepers.Apply(keepers =\u003e keepers.AmiId),\n });\n // ... (other aws_instance arguments) ...\n }\n\n}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\n# Random IDs can be imported using the b64_url with an optional prefix. This # can be used to replace a config value with a value interpolated from the # random provider without experiencing diffs. # Example with no prefix\n\n```sh\n $ pulumi import random:index/randomId:RandomId server p-9hUg\n```\n\n # Example with prefix (prefix is separated by a ,)\n\n```sh\n $ pulumi import random:index/randomId:RandomId server my-prefix-,p-9hUg\n```\n\n ",
"inputProperties": {
"byteLength": {
"description": "The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.\n",
"type": "integer"
},
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"prefix": {
"description": "Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.\n",
"type": "string"
}
},
"properties": {
"b64Std": {
"description": "The generated id presented in base64 without additional transformations.\n",
"type": "string"
},
"b64Url": {
"description": "The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the characters `_` and `-`.\n",
"type": "string"
},
"byteLength": {
"description": "The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.\n",
"type": "integer"
},
"dec": {
"description": "The generated id presented in non-padded decimal digits.\n",
"type": "string"
},
"hex": {
"description": "The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte length.\n",
"type": "string"
},
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"prefix": {
"description": "Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.\n",
"type": "string"
}
},
"required": [
"b64Std",
"b64Url",
"byteLength",
"dec",
"hex"
],
"requiredInputs": [
"byteLength"
],
"stateInputs": {
"description": "Input properties used for looking up and filtering RandomId resources.\n",
"properties": {
"b64Std": {
"description": "The generated id presented in base64 without additional transformations.\n",
"type": "string"
},
"b64Url": {
"description": "The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the characters `_` and `-`.\n",
"type": "string"
},
"byteLength": {
"description": "The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.\n",
"type": "integer"
},
"dec": {
"description": "The generated id presented in non-padded decimal digits.\n",
"type": "string"
},
"hex": {
"description": "The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte length.\n",
"type": "string"
},
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"prefix": {
"description": "Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be URL-safe or base64 encoded.\n",
"type": "string"
}
},
"type": "object"
}
},
"random:index/randomInteger:RandomInteger": {
"description": "The resource `random.RandomInteger` generates random values from a given range, described by the `min` and `max` attributes of a given resource.\n\nThis resource can be used in conjunction with resources that have the `create_before_destroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a random priority\n// between 1 and 50000 for a aws_alb_listener_rule resource:\nconst priority = new random.RandomInteger(\"priority\", {\n min: 1,\n max: 50000,\n keepers: {\n listener_arn: _var.listener_arn,\n },\n});\nconst main = new aws.alb.ListenerRule(\"main\", {\n listenerArn: _var.listener_arn,\n priority: priority.result,\n actions: [{\n type: \"forward\",\n targetGroupArn: _var.target_group_arn,\n }],\n});\n// ... (other aws_alb_listener_rule arguments) ...\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a random priority\n# between 1 and 50000 for a aws_alb_listener_rule resource:\npriority = random.RandomInteger(\"priority\",\n min=1,\n max=50000,\n keepers={\n \"listener_arn\": var[\"listener_arn\"],\n })\nmain = aws.alb.ListenerRule(\"main\",\n listener_arn=var[\"listener_arn\"],\n priority=priority.result,\n actions=[aws.alb.ListenerRuleActionArgs(\n type=\"forward\",\n target_group_arn=var[\"target_group_arn\"],\n )])\n# ... (other aws_alb_listener_rule arguments) ...\n```\n```csharp\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n // The following example shows how to generate a random priority\n // between 1 and 50000 for a aws_alb_listener_rule resource:\n var priority = new Random.RandomInteger(\"priority\", new Random.RandomIntegerArgs\n {\n Min = 1,\n Max = 50000,\n Keepers = \n {\n { \"listener_arn\", @var.Listener_arn },\n },\n });\n var main = new Aws.Alb.ListenerRule(\"main\", new Aws.Alb.ListenerRuleArgs\n {\n ListenerArn = @var.Listener_arn,\n Priority = priority.Result,\n Actions = \n {\n new Aws.Alb.Inputs.ListenerRuleActionArgs\n {\n Type = \"forward\",\n TargetGroupArn = @var.Target_group_arn,\n },\n },\n });\n // ... (other aws_alb_listener_rule arguments) ...\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/alb\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tpriority, err := random.NewRandomInteger(ctx, \"priority\", \u0026random.RandomIntegerArgs{\n\t\t\tMin: pulumi.Int(1),\n\t\t\tMax: pulumi.Int(50000),\n\t\t\tKeepers: pulumi.AnyMap{\n\t\t\t\t\"listener_arn\": pulumi.Any(_var.Listener_arn),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = alb.NewListenerRule(ctx, \"main\", \u0026alb.ListenerRuleArgs{\n\t\t\tListenerArn: pulumi.Any(_var.Listener_arn),\n\t\t\tPriority: priority.Result,\n\t\t\tActions: alb.ListenerRuleActionArray{\n\t\t\t\t\u0026alb.ListenerRuleActionArgs{\n\t\t\t\t\tType: pulumi.String(\"forward\"),\n\t\t\t\t\tTargetGroupArn: pulumi.Any(_var.Target_group_arn),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\n# Random integers can be imported using the result, min, and max, with an # optional seed. This can be used to replace a config value with a value # interpolated from the random provider without experiencing diffs. # Example (values are separated by a ,)\n\n```sh\n $ pulumi import random:index/randomInteger:RandomInteger priority 15390,1,50000\n```\n\n ",
"inputProperties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"max": {
"description": "The maximum inclusive value of the range.\n",
"type": "integer"
},
"min": {
"description": "The minimum inclusive value of the range.\n",
"type": "integer"
},
"seed": {
"description": "A custom seed to always produce the same value.\n",
"type": "string"
}
},
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"max": {
"description": "The maximum inclusive value of the range.\n",
"type": "integer"
},
"min": {
"description": "The minimum inclusive value of the range.\n",
"type": "integer"
},
"result": {
"description": "The random integer result.\n",
"type": "integer"
},
"seed": {
"description": "A custom seed to always produce the same value.\n",
"type": "string"
}
},
"required": [
"max",
"min",
"result"
],
"requiredInputs": [
"max",
"min"
],
"stateInputs": {
"description": "Input properties used for looking up and filtering RandomInteger resources.\n",
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"max": {
"description": "The maximum inclusive value of the range.\n",
"type": "integer"
},
"min": {
"description": "The minimum inclusive value of the range.\n",
"type": "integer"
},
"result": {
"description": "The random integer result.\n",
"type": "integer"
},
"seed": {
"description": "A custom seed to always produce the same value.\n",
"type": "string"
}
},
"type": "object"
}
},
"random:index/randomPassword:RandomPassword": {
"description": "Identical to random.RandomString with the exception that the result is treated as sensitive and, thus, _not_ displayed in console output.\n\nThis resource *does* use a cryptographic random number generator.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\nconst password = new random.RandomPassword(\"password\", {\n length: 16,\n special: true,\n overrideSpecial: `_%@`,\n});\nconst example = new aws.rds.Instance(\"example\", {\n instanceClass: \"db.t3.micro\",\n allocatedStorage: 64,\n engine: \"mysql\",\n username: \"someone\",\n password: password.result,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\npassword = random.RandomPassword(\"password\",\n length=16,\n special=True,\n override_special=\"_%@\")\nexample = aws.rds.Instance(\"example\",\n instance_class=\"db.t3.micro\",\n allocated_storage=64,\n engine=\"mysql\",\n username=\"someone\",\n password=password.result)\n```\n```csharp\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var password = new Random.RandomPassword(\"password\", new Random.RandomPasswordArgs\n {\n Length = 16,\n Special = true,\n OverrideSpecial = \"_%@\",\n });\n var example = new Aws.Rds.Instance(\"example\", new Aws.Rds.InstanceArgs\n {\n InstanceClass = \"db.t3.micro\",\n AllocatedStorage = 64,\n Engine = \"mysql\",\n Username = \"someone\",\n Password = password.Result,\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/rds\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tpassword, err := random.NewRandomPassword(ctx, \"password\", \u0026random.RandomPasswordArgs{\n\t\t\tLength: pulumi.Int(16),\n\t\t\tSpecial: pulumi.Bool(true),\n\t\t\tOverrideSpecial: pulumi.String(fmt.Sprintf(\"%v%v%v\", \"_\", \"%\", \"@\")),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = rds.NewInstance(ctx, \"example\", \u0026rds.InstanceArgs{\n\t\t\tInstanceClass: pulumi.String(\"db.t3.micro\"),\n\t\t\tAllocatedStorage: pulumi.Int(64),\n\t\t\tEngine: pulumi.String(\"mysql\"),\n\t\t\tUsername: pulumi.String(\"someone\"),\n\t\t\tPassword: password.Result,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\n# Random Password can be imported by specifying the value of the string\n\n```sh\n $ pulumi import random:index/randomPassword:RandomPassword password securepassword\n```\n\n ",
"inputProperties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length of the string desired.\n",
"type": "integer"
},
"lower": {
"description": "Include lowercase alphabet characters in the result.\n",
"type": "boolean"
},
"minLower": {
"description": "Minimum number of lowercase alphabet characters in the result.\n",
"type": "integer"
},
"minNumeric": {
"description": "Minimum number of numeric characters in the result.\n",
"type": "integer"
},
"minSpecial": {
"description": "Minimum number of special characters in the result.\n",
"type": "integer"
},
"minUpper": {
"description": "Minimum number of uppercase alphabet characters in the result.\n",
"type": "integer"
},
"number": {
"description": "Include numeric characters in the result.\n",
"type": "boolean"
},
"overrideSpecial": {
"description": "Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The `special` argument must still be set to true for any overwritten characters to be used in generation.\n",
"type": "string"
},
"special": {
"description": "Include special characters in the result. These are `!@#$%\u0026*()-_=+[]{}\u003c\u003e:?`\n",
"type": "boolean"
},
"upper": {
"description": "Include uppercase alphabet characters in the result.\n",
"type": "boolean"
}
},
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length of the string desired.\n",
"type": "integer"
},
"lower": {
"description": "Include lowercase alphabet characters in the result.\n",
"type": "boolean"
},
"minLower": {
"description": "Minimum number of lowercase alphabet characters in the result.\n",
"type": "integer"
},
"minNumeric": {
"description": "Minimum number of numeric characters in the result.\n",
"type": "integer"
},
"minSpecial": {
"description": "Minimum number of special characters in the result.\n",
"type": "integer"
},
"minUpper": {
"description": "Minimum number of uppercase alphabet characters in the result.\n",
"type": "integer"
},
"number": {
"description": "Include numeric characters in the result.\n",
"type": "boolean"
},
"overrideSpecial": {
"description": "Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The `special` argument must still be set to true for any overwritten characters to be used in generation.\n",
"type": "string"
},
"result": {
"description": "The generated random string.\n",
"type": "string"
},
"special": {
"description": "Include special characters in the result. These are `!@#$%\u0026*()-_=+[]{}\u003c\u003e:?`\n",
"type": "boolean"
},
"upper": {
"description": "Include uppercase alphabet characters in the result.\n",
"type": "boolean"
}
},
"required": [
"length",
"result"
],
"requiredInputs": [
"length"
],
"stateInputs": {
"description": "Input properties used for looking up and filtering RandomPassword resources.\n",
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length of the string desired.\n",
"type": "integer"
},
"lower": {
"description": "Include lowercase alphabet characters in the result.\n",
"type": "boolean"
},
"minLower": {
"description": "Minimum number of lowercase alphabet characters in the result.\n",
"type": "integer"
},
"minNumeric": {
"description": "Minimum number of numeric characters in the result.\n",
"type": "integer"
},
"minSpecial": {
"description": "Minimum number of special characters in the result.\n",
"type": "integer"
},
"minUpper": {
"description": "Minimum number of uppercase alphabet characters in the result.\n",
"type": "integer"
},
"number": {
"description": "Include numeric characters in the result.\n",
"type": "boolean"
},
"overrideSpecial": {
"description": "Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The `special` argument must still be set to true for any overwritten characters to be used in generation.\n",
"type": "string"
},
"result": {
"description": "The generated random string.\n",
"type": "string"
},
"special": {
"description": "Include special characters in the result. These are `!@#$%\u0026*()-_=+[]{}\u003c\u003e:?`\n",
"type": "boolean"
},
"upper": {
"description": "Include uppercase alphabet characters in the result.\n",
"type": "boolean"
}
},
"type": "object"
}
},
"random:index/randomPet:RandomPet": {
"description": "The resource `random.RandomPet` generates random pet names that are intended to be used as unique identifiers for other resources.\n\nThis resource can be used in conjunction with resources that have the `create_before_destroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\n// The following example shows how to generate a unique pet name\n// for an AWS EC2 instance that changes each time a new AMI id is\n// selected.\nconst serverRandomPet = new random.RandomPet(\"serverRandomPet\", {keepers: {\n ami_id: _var.ami_id,\n}});\nconst serverInstance = new aws.ec2.Instance(\"serverInstance\", {\n tags: {\n Name: pulumi.interpolate`web-server-${serverRandomPet.id}`,\n },\n ami: serverRandomPet.keepers.amiId,\n});\n// ... (other aws_instance arguments) ...\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\n# The following example shows how to generate a unique pet name\n# for an AWS EC2 instance that changes each time a new AMI id is\n# selected.\nserver_random_pet = random.RandomPet(\"serverRandomPet\", keepers={\n \"ami_id\": var[\"ami_id\"],\n})\nserver_instance = aws.ec2.Instance(\"serverInstance\",\n tags={\n \"Name\": server_random_pet.id.apply(lambda id: f\"web-server-{id}\"),\n },\n ami=server_random_pet.keepers[\"amiId\"])\n# ... (other aws_instance arguments) ...\n```\n```csharp\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n // The following example shows how to generate a unique pet name\n // for an AWS EC2 instance that changes each time a new AMI id is\n // selected.\n var serverRandomPet = new Random.RandomPet(\"serverRandomPet\", new Random.RandomPetArgs\n {\n Keepers = \n {\n { \"ami_id\", @var.Ami_id },\n },\n });\n var serverInstance = new Aws.Ec2.Instance(\"serverInstance\", new Aws.Ec2.InstanceArgs\n {\n Tags = \n {\n { \"Name\", serverRandomPet.Id.Apply(id =\u003e $\"web-server-{id}\") },\n },\n Ami = serverRandomPet.Keepers.Apply(keepers =\u003e keepers.AmiId),\n });\n // ... (other aws_instance arguments) ...\n }\n\n}\n```\n{{% /example %}}\n{{% /examples %}}",
"inputProperties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length (in words) of the pet name.\n",
"type": "integer"
},
"prefix": {
"description": "A string to prefix the name with.\n",
"type": "string"
},
"separator": {
"description": "The character to separate words in the pet name.\n",
"type": "string"
}
},
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length (in words) of the pet name.\n",
"type": "integer"
},
"prefix": {
"description": "A string to prefix the name with.\n",
"type": "string"
},
"separator": {
"description": "The character to separate words in the pet name.\n",
"type": "string"
}
},
"stateInputs": {
"description": "Input properties used for looking up and filtering RandomPet resources.\n",
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length (in words) of the pet name.\n",
"type": "integer"
},
"prefix": {
"description": "A string to prefix the name with.\n",
"type": "string"
},
"separator": {
"description": "The character to separate words in the pet name.\n",
"type": "string"
}
},
"type": "object"
}
},
"random:index/randomShuffle:RandomShuffle": {
"description": "The resource `random.RandomShuffle` generates a random permutation of a list of strings given as an argument.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\n\nconst az = new random.RandomShuffle(\"az\", {\n inputs: [\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n ],\n resultCount: 2,\n});\nconst example = new aws.elb.LoadBalancer(\"example\", {\n // Place the ELB in any two of the given availability zones, selected\n // at random.\n availabilityZones: az.results,\n});\n```\n```python\nimport pulumi\nimport pulumi_aws as aws\nimport pulumi_random as random\n\naz = random.RandomShuffle(\"az\",\n inputs=[\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n ],\n result_count=2)\nexample = aws.elb.LoadBalancer(\"example\", availability_zones=az.results)\n```\n```csharp\nusing Pulumi;\nusing Aws = Pulumi.Aws;\nusing Random = Pulumi.Random;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var az = new Random.RandomShuffle(\"az\", new Random.RandomShuffleArgs\n {\n Inputs = \n {\n \"us-west-1a\",\n \"us-west-1c\",\n \"us-west-1d\",\n \"us-west-1e\",\n },\n ResultCount = 2,\n });\n var example = new Aws.Elb.LoadBalancer(\"example\", new Aws.Elb.LoadBalancerArgs\n {\n AvailabilityZones = az.Results,\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/elb\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\taz, err := random.NewRandomShuffle(ctx, \"az\", \u0026random.RandomShuffleArgs{\n\t\t\tInputs: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"us-west-1a\"),\n\t\t\t\tpulumi.String(\"us-west-1c\"),\n\t\t\t\tpulumi.String(\"us-west-1d\"),\n\t\t\t\tpulumi.String(\"us-west-1e\"),\n\t\t\t},\n\t\t\tResultCount: pulumi.Int(2),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = elb.NewLoadBalancer(ctx, \"example\", \u0026elb.LoadBalancerArgs{\n\t\t\tAvailabilityZones: az.Results,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}",
"inputProperties": {
"inputs": {
"description": "The list of strings to shuffle.\n",
"items": {
"type": "string"
},
"type": "array"
},
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"resultCount": {
"description": "The number of results to return. Defaults to the number of items in the `input` list. If fewer items are requested, some elements will be excluded from the result. If more items are requested, items will be repeated in the result but not more frequently than the number of items in the input list.\n",
"type": "integer"
},
"seed": {
"description": "Arbitrary string with which to seed the random number generator, in order to produce less-volatile permutations of the list.\n",
"type": "string"
}
},
"properties": {
"inputs": {
"description": "The list of strings to shuffle.\n",
"items": {
"type": "string"
},
"type": "array"
},
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"resultCount": {
"description": "The number of results to return. Defaults to the number of items in the `input` list. If fewer items are requested, some elements will be excluded from the result. If more items are requested, items will be repeated in the result but not more frequently than the number of items in the input list.\n",
"type": "integer"
},
"results": {
"description": "Random permutation of the list of strings given in `input`.\n",
"items": {
"type": "string"
},
"type": "array"
},
"seed": {
"description": "Arbitrary string with which to seed the random number generator, in order to produce less-volatile permutations of the list.\n",
"type": "string"
}
},
"required": [
"inputs",
"results"
],
"requiredInputs": [
"inputs"
],
"stateInputs": {
"description": "Input properties used for looking up and filtering RandomShuffle resources.\n",
"properties": {
"inputs": {
"description": "The list of strings to shuffle.\n",
"items": {
"type": "string"
},
"type": "array"
},
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"resultCount": {
"description": "The number of results to return. Defaults to the number of items in the `input` list. If fewer items are requested, some elements will be excluded from the result. If more items are requested, items will be repeated in the result but not more frequently than the number of items in the input list.\n",
"type": "integer"
},
"results": {
"description": "Random permutation of the list of strings given in `input`.\n",
"items": {
"type": "string"
},
"type": "array"
},
"seed": {
"description": "Arbitrary string with which to seed the random number generator, in order to produce less-volatile permutations of the list.\n",
"type": "string"
}
},
"type": "object"
}
},
"random:index/randomString:RandomString": {
"description": "The resource `random.RandomString` generates a random permutation of alphanumeric characters and optionally special characters.\n\nThis resource *does* use a cryptographic random number generator.\n\nHistorically this resource's intended usage has been ambiguous as the original example used it in a password. For backwards compatibility it will continue to exist. For unique ids please use random_id, for sensitive random values please use random_password.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as random from \"@pulumi/random\";\n\nconst randomRandomString = new random.RandomString(\"random\", {\n length: 16,\n overrideSpecial: \"/@£$\",\n special: true,\n});\n```\n```python\nimport pulumi\nimport pulumi_random as random\n\nrandom = random.RandomString(\"random\",\n length=16,\n override_special=\"/@£$\",\n special=True)\n```\n```csharp\nusing Pulumi;\nusing Random = Pulumi.Random;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var random = new Random.RandomString(\"random\", new Random.RandomStringArgs\n {\n Length = 16,\n OverrideSpecial = \"/@£$\",\n Special = true,\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := random.NewRandomString(ctx, \"random\", \u0026random.RandomStringArgs{\n\t\t\tLength: pulumi.Int(16),\n\t\t\tOverrideSpecial: pulumi.String(fmt.Sprintf(\"%v%v\", \"/@£\", \"$\")),\n\t\t\tSpecial: pulumi.Bool(true),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\n# Strings can be imported by just specifying the value of the string\n\n```sh\n $ pulumi import random:index/randomString:RandomString test test\n```\n\n ",
"inputProperties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length of the string desired.\n",
"type": "integer"
},
"lower": {
"description": "Include lowercase alphabet characters in the result.\n",
"type": "boolean"
},
"minLower": {
"description": "Minimum number of lowercase alphabet characters in the result.\n",
"type": "integer"
},
"minNumeric": {
"description": "Minimum number of numeric characters in the result.\n",
"type": "integer"
},
"minSpecial": {
"description": "Minimum number of special characters in the result.\n",
"type": "integer"
},
"minUpper": {
"description": "Minimum number of uppercase alphabet characters in the result.\n",
"type": "integer"
},
"number": {
"description": "Include numeric characters in the result.\n",
"type": "boolean"
},
"overrideSpecial": {
"description": "Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The `special` argument must still be set to true for any overwritten characters to be used in generation.\n",
"type": "string"
},
"special": {
"description": "Include special characters in the result. These are `!@#$%\u0026*()-_=+[]{}\u003c\u003e:?`\n",
"type": "boolean"
},
"upper": {
"description": "Include uppercase alphabet characters in the result.\n",
"type": "boolean"
}
},
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length of the string desired.\n",
"type": "integer"
},
"lower": {
"description": "Include lowercase alphabet characters in the result.\n",
"type": "boolean"
},
"minLower": {
"description": "Minimum number of lowercase alphabet characters in the result.\n",
"type": "integer"
},
"minNumeric": {
"description": "Minimum number of numeric characters in the result.\n",
"type": "integer"
},
"minSpecial": {
"description": "Minimum number of special characters in the result.\n",
"type": "integer"
},
"minUpper": {
"description": "Minimum number of uppercase alphabet characters in the result.\n",
"type": "integer"
},
"number": {
"description": "Include numeric characters in the result.\n",
"type": "boolean"
},
"overrideSpecial": {
"description": "Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The `special` argument must still be set to true for any overwritten characters to be used in generation.\n",
"type": "string"
},
"result": {
"description": "The generated random string.\n",
"type": "string"
},
"special": {
"description": "Include special characters in the result. These are `!@#$%\u0026*()-_=+[]{}\u003c\u003e:?`\n",
"type": "boolean"
},
"upper": {
"description": "Include uppercase alphabet characters in the result.\n",
"type": "boolean"
}
},
"required": [
"length",
"result"
],
"requiredInputs": [
"length"
],
"stateInputs": {
"description": "Input properties used for looking up and filtering RandomString resources.\n",
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"length": {
"description": "The length of the string desired.\n",
"type": "integer"
},
"lower": {
"description": "Include lowercase alphabet characters in the result.\n",
"type": "boolean"
},
"minLower": {
"description": "Minimum number of lowercase alphabet characters in the result.\n",
"type": "integer"
},
"minNumeric": {
"description": "Minimum number of numeric characters in the result.\n",
"type": "integer"
},
"minSpecial": {
"description": "Minimum number of special characters in the result.\n",
"type": "integer"
},
"minUpper": {
"description": "Minimum number of uppercase alphabet characters in the result.\n",
"type": "integer"
},
"number": {
"description": "Include numeric characters in the result.\n",
"type": "boolean"
},
"overrideSpecial": {
"description": "Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument. The `special` argument must still be set to true for any overwritten characters to be used in generation.\n",
"type": "string"
},
"result": {
"description": "The generated random string.\n",
"type": "string"
},
"special": {
"description": "Include special characters in the result. These are `!@#$%\u0026*()-_=+[]{}\u003c\u003e:?`\n",
"type": "boolean"
},
"upper": {
"description": "Include uppercase alphabet characters in the result.\n",
"type": "boolean"
}
},
"type": "object"
}
},
"random:index/randomUuid:RandomUuid": {
"description": "The resource `random.RandomUuid` generates random uuid string that is intended to be used as unique identifiers for other resources.\n\nThis resource uses [hashicorp/go-uuid](https://github.com/hashicorp/go-uuid) to generate a UUID-formatted string for use with services needed a unique string identifier.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as azure from \"@pulumi/azure\";\nimport * as random from \"@pulumi/random\";\n\nconst testRandomUuid = new random.RandomUuid(\"test\", {});\nconst testResourceGroup = new azure.core.ResourceGroup(\"test\", {\n location: \"Central US\",\n});\n```\n```python\nimport pulumi\nimport pulumi_azure as azure\nimport pulumi_random as random\n\ntest_random_uuid = random.RandomUuid(\"testRandomUuid\")\ntest_resource_group = azure.core.ResourceGroup(\"testResourceGroup\", location=\"Central US\")\n```\n```csharp\nusing Pulumi;\nusing Azure = Pulumi.Azure;\nusing Random = Pulumi.Random;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var testRandomUuid = new Random.RandomUuid(\"testRandomUuid\", new Random.RandomUuidArgs\n {\n });\n var testResourceGroup = new Azure.Core.ResourceGroup(\"testResourceGroup\", new Azure.Core.ResourceGroupArgs\n {\n Location = \"Central US\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core\"\n\t\"github.com/pulumi/pulumi-random/sdk/v4/go/random\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := random.NewRandomUuid(ctx, \"testRandomUuid\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = core.NewResourceGroup(ctx, \"testResourceGroup\", \u0026core.ResourceGroupArgs{\n\t\t\tLocation: pulumi.String(\"Central US\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\n# Random UUID's can be imported. This can be used to replace a config # value with a value interpolated from the random provider without # experiencing diffs.\n\n```sh\n $ pulumi import random:index/randomUuid:RandomUuid main aabbccdd-eeff-0011-2233-445566778899\n```\n\n ",
"inputProperties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
}
},
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"result": {
"description": "The generated uuid presented in string format.\n",
"type": "string"
}
},
"required": [
"result"
],
"stateInputs": {
"description": "Input properties used for looking up and filtering RandomUuid resources.\n",
"properties": {
"keepers": {
"additionalProperties": {
"$ref": "pulumi.json#/Any"
},
"description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n",
"type": "object"
},
"result": {
"description": "The generated uuid presented in string format.\n",
"type": "string"
}
},
"type": "object"
}
}
},
"version": "4.2.0"
}