{"id":23410,"library":"cdktf-cdktf-provider-random","title":"CDKTF Provider Random","description":"Prebuilt Terraform CDK (CDKTF) provider for random resources (random_pet, random_string, random_password, etc.). Used to generate random values in infrastructure. Version 12.0.1 supports CDKTF >= 0.20.0. Breaking changes between major versions often mirror the upstream provider version bumps.","status":"active","version":"12.0.1","language":"python","source_language":"en","source_url":"https://github.com/cdktf/cdktf-provider-random","tags":["cdktf","terraform","provider","random","infrastructure"],"install":[{"cmd":"pip install cdktf-cdktf-provider-random","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core CDKTF library required","package":"cdktf","optional":false},{"reason":"Base constructs library","package":"constructs","optional":false}],"imports":[{"note":"Resource classes must be imported from their specific module, not the package root.","wrong":"from cdktf_cdktf_provider_random import RandomPet","symbol":"RandomPet","correct":"from cdktf_cdktf_provider_random.pet import RandomPet"},{"note":"Same as above: resource classes are in submodules.","wrong":"from cdktf_cdktf_provider_random import RandomString","symbol":"RandomString","correct":"from cdktf_cdktf_provider_random.string import RandomString"},{"note":"Import path follows the pattern: cdktf_cdktf_provider_random.<resource_type>","wrong":null,"symbol":"RandomPassword","correct":"from cdktf_cdktf_provider_random.password import RandomPassword"}],"quickstart":{"code":"from cdktf import App, TerraformStack\nfrom cdktf_cdktf_provider_random.pet import RandomPet\nfrom constructs import Construct\n\nclass MyStack(TerraformStack):\n    def __init__(self, scope: Construct, id: str):\n        super().__init__(scope, id)\n        RandomPet(self, \"pet\", keepers={\"key\": \"value\"})\n\napp = App()\nMyStack(app, \"random-pet-stack\")\napp.synth()","lang":"python","description":"Creates a CDKTF stack with a RandomPet resource."},"warnings":[{"fix":"Update cdktf to >=0.20.0, or pin cdktf-cdktf-provider-random to <12.0.0.","message":"Version 12.0.0+ requires cdktf >= 0.20.0. Older cdktf versions are incompatible.","severity":"breaking","affected_versions":">=12.0.0"},{"fix":"Use correct import paths: from cdktf_cdktf_provider_random.pet import RandomPet","message":"Resource classes (RandomPet, RandomString, etc.) are not exported from the package root. Importing directly from root will raise ModuleNotFoundError.","severity":"gotcha","affected_versions":"all"},{"fix":"Use integer values directly: length=8 (not '8' string).","message":"Some attributes like 'length' in RandomString require explicit type casting in Python due to Terraform type system.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install cdktf-cdktf-provider-random (note hyphen vs underscore in package name).","cause":"Package not installed or wrong import path.","error":"ModuleNotFoundError: No module named 'cdktf_cdktf_provider_random'"},{"fix":"from cdktf_cdktf_provider_random.pet import RandomPet","cause":"Attempting to import resource class from package root instead of submodule.","error":"ImportError: cannot import name 'RandomPet' from 'cdktf_cdktf_provider_random'"},{"fix":"Provide all required arguments as per Terraform provider docs.","cause":"Missing required 'keepers' argument in RandomPet or similar resource with required attributes.","error":"TypeError: 'NoneType' object is not iterable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}