Saravanan666/pypi-org huggingface dataset:
Package: cdk-ssm-secure-iam-access-key
cdk-ssm-secure-iam-access-keyCreates an IAM Access Key for a provided IAM User and stores the result in an SSM SecureString ParameterNPM PackageInstallationnpm i -D cdk-ssm-secure-iam-access-keyUsageconstuser=newiam.User(this,"SMTPUser");user.addToPolicy(newiam.PolicyStatement({effect:iam.Effect.ALLOW,actions:["ses:SendRawEmail"],resources:["*"],}));newSSMSecureIAMAccessKey(this,"SMTPUserCredentials",{parameterName:"/smtpCredentials",user,});//JSON.stringified{accessKeyId:"...",secretAccessKey:"..."}returnssm.StringParameter.fromSecureStringParameterAttributes(this,"SMTPUserCredentialsSSM",{parameterName:"/smtpCredentials",});
Package: cdk-stack-resource-rename
StackResourceRenamerA CDK aspect, StackResourceRenamer renames CDK stack name and stack's subordinate resources' physical names, so that a CDK stack can be used to create multiple stacks in same AWS environment without confliction.API:API.mdTwo main use cases:rename custom resources names in stack, so that stack can be reused and replicated:# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826StackResourceRenamer.rename(stack,rename=(resName,_)=>{returnresName+'-'+alias;})for resources without custom name, which by default will use unique id AWS auto generate as its physical id, we can create a more readable and identifiable name, for testing, debugging or metrics monitoring environments.# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826StackResourceRenamer.rename(stack,{"rename":(_,typeName)=>{counts[typeName]++;returnprojectName+'-'+serviceName+'-'+typeName+'-'+counts[typeName];}},user_custom_name_only=False)Samplestypescript# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826fromcdk_stack_resource_renameimportStackResourceRenamerapp=core.App()stack=core.Stack(app,"my-stack")alias=stack.node.try_get_context("alias")ifalias:# if alias is defined, rename stack and resources' custom namesStackResourceRenamer.rename(stack,rename=(resName,_)=>{returnresName+'-'+alias;})# resources in stackbucket=s3.Bucket(stack,"bucket",bucket_name="my-bucket")pythonfromcdk_stack_resource_renameimport(StackResourceRenamer,IRenameOperation)@jsii.implements(IRenameOperation)classRenameOper:def__init__(self,alias):self.alias=aliasdefrename(self,resName,typeName):returnresName+'-'+self.aliasclassAppStack(core.Stack):def__init__(self,scope:core.Construct,construct_id:str,**kwargs)->None:......alias=self.node.try_get_context("alias")ifalias!=None:# if alias is defined, rename stack/resources' custom namesStackResourceRenamer.rename(self,RenameOper(alias))javaimportio.github.yglcode.cdkutils.aspects.resourcerename.StackResourceRenamer;importio.github.yglcode.cdkutils.aspects.resourcerename.IRenameOperation;publicclassAppStackextendsStack{......Stringalias=(String)this.getNode().tryGetContext("alias");if(alias!=null){StackResourceRenamer.rename(this,newIRenameOperation(){publicStringrename(StringresName,StringtypeName){returnresName+"-"+alias;}});}csharpusingCdkUtils.Aspects.ResourceRename;publicclassRenameOper:Amazon.JSII.Runtime.Deputy.DeputyBase,IRenameOperation{privatestringalias;publicRenameOper(stringalias){this.alias=alias;}publicstringRename(stringresName,stringtypeName){returnresName+"-"+alias;}}publicclassAppStack:Stack{internalAppStack(Constructscope,stringid,IStackPropsprops=null):base(scope,id,props){......varalias=(string)this.Node.TryGetContext("alias");if(alias!=null){StackResourceRenamer.Rename(this,newRenameOper(alias));}To create multiple stacks:cdk -c alias=a1 deploywill create a stack: my-stack-a1 with my-bucket-a1.To create more stacks: my-stack-a2 with my-bucket-a2, my-stack-a3 with my-bucket-a3:cdk -c alias=a2 deploycdk -c alias=a3 deploy
Package: cdk-static-site
CDK Static Website ConstructThis package contains a high-level CDK construct for describing the infrastructure of
a static website. The construct also features adeploymethod to deploy static assets
for the website and invalidate the CloudFront distribution.The CDK construct creates the private S3 bucket, where the website is hosted. The contents
of the bucket are exposed through a CloudFront distribution. Rather than allowing public
access to the bucket, OAI is used to allow access from CloudFront only.Further reading:https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.htmlThis construct also creates the necessary Route 53 records to route requests to
the CloudFront distribution. It also configures the distribution with a supplied
SSL certificate.Pre-requisitesThis construct works with recent versions of CDK v2. There are similar constructs
on PyPI for v1 - one of the motivations for this package was to support v2.If you are not familiar with CDK, have a readhere.Registering a domain name, creating the hosted zone in Route 53 and creating the SSL
certificate are not in scope for this construct. These can be created manually or
through other automated ways on AWS.Note, the certificate needs to be created in North Virginia (us-east-1).Once these are created, you should have all the necessary inputs: the domain name,
domain certificate ARN, the hosted zone ID and the hosted zone name.How to use it?Install the package using your favourite package manager, e.g.pipinstallcdk-static-siteWithin your stack, instantiate the constructfromstatic_siteimportStaticSitesite=StaticSite(scope=self,construct_id="StaticSite",site_domain_name=site_domain_name,hosted_zone_id=hosted_zone_id,hosted_zone_name=hosted_zone_name,domain_certificate_arn=domain_certificate_arn,)and finally, deploy the static contents by supplying the directory path
todeploy:frompathlibimportPathcontents_path=Path.cwd()/"public"# or wherever your assets are locatedsite.deploy(contents_path.as_posix())ContributionIf you find any issues, or have suggestions to improve the construct, feel free to
open an issue/PR.
Package: cdk-static-website
Simple static site CDK constructThis constructs creates a static website hosted on S3.RequirementsHosted zone in Route53UsageThis constructs creates:S3 bucketDNS Validated certificateCloudFront web distributionRoute53 A recordfromaws_cdk.coreimportStack,Constructfromstatic_websiteimportStaticWebsitefromaws_cdk.aws_route53importHostedZoneclassWebSiteStack(Stack):def__init__(self,scope:Construct,id:str,**kwargs):super().__init__(scope,id,**kwargs)# The code that defines your stack goes herezone=HostedZone.from_lookup(self,"HostedZone",domain_name="mydomain.com",private_zone=False)StaticWebsite(self,"serverlesslink-website",hosted_zone=zone,site_domain="blog.mydomain.com",sources="../public",website_error="404.html")
Package: cdk-static-wordpress
CDK Static WordpressThe goal of this project is to make it easy to deploy a static website, generated byWordpressas simple and cost-effective as possible.It's largely inspired byTechToSpeech/terraform-aws-serverless-static-wordpress,
but usesAWS CDKinstead of Terraform.It creates the infrastructure to launch a temporary, transient Wordpress container. You then log in and customize it
like any Wordpress site, and finally publish it as a static site fronted by a global CloudFront CDN and S3 Origin. When
you’re done you shut down the Wordpress container and it costs you almost nothing.WP2Staticis used to generate the static site from the Wordpress container.Quick StartInstall the construct:yarnadd@blimmer/cdk-static-wordpress# ornpmi--save@blimmer/cdk-static-wordpressInstantiate aStaticWordpressinstance aStack:import{StaticWordpress}from"@blimmer/cdk-static-wordpress";import{Stack,StackProps}from"aws-cdk-lib";import{HostedZone}from"aws-cdk-lib/aws-route53";import{Construct}from"constructs";exportclassStaticWordpressStackextendsStack{constructor(scope:Construct,id:string,props?:StackProps){super(scope,id,props);//Youcancreateorimportahostedzone//Seehttps://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53.HostedZone.htmlconstexampleHostedZone=newHostedZone(this,"ExampleHostedZone",{zoneName:"example.com",});newStaticWordpress(this,"StaticWordpress",{fullyQualifiedSiteName:"blog.example.com",hostedZone:exampleHostedZone,wordpressAdminProps:{email:"me@example.com",},});}}Deploy with thecdk deploycommandOnce the deployment completes, visit the Wordpress console atadmin-<fullyQualifiedSiteName>. E.g., if your static
site isblog.example.com, visitadmin-blog.example.com/wp-admin. The default password for the wordpress user
ischangeme(please change it :smile:).Customize Wordpress as you see fit, create posts, etc.When you're ready to deploy your static site, trigger WP2Static.Visit your static site (e.g.,blog.example.com) once WP2Static completes.(optional) Shut down the Wordpress container to save money.newStaticWordpress(this,"StaticWordpress",{fullyQualifiedSiteName:"blog.example.com",hostedZone:exampleHostedZone,wordpressAdminProps:{email:"me@example.com",run:false,//<--Shutdownthecontainerafterdeployment},});ArchitectureTODOEscape HatchesThis construct provides escape hatches, to allow you to customize the underlying infrastructure if you need to. This is
a big benefit of using CDK over Terraform (where every customizable property must be manually exposed as a variable).Look for*Overridesinthe API docsfor customization options. But, be warned, we allow overriding almost
everything, so you can easily produce invalid infrastructure if you don't know what you're doing.
Package: cdktest
Python Test Helper for AWS CDKThis simple helper facilitates testing CDK constructs from Python unit tests, by wrapping the CDK executable and exposing
convenience methods to set up fixtures, execute CDK commands, and parse their output.It allows for different types of tests: lightweight tests that only use CDKsynthesizeto ensure code is syntactically
correct and the right number and type of resources should be created, or full-fledged tests that run the fulldeploycycle,
and can then be used to test the actual created resources.This tool is heavily inspired by this project:terraform-python-testing-helper.Example UsageThetestsfolder contains simple examples on how to
write tests for bothsynthanddeploy.This is a test that uses synth output on an actual module:importpytestimportcdktestimportjson@pytest.fixturedefoutput(fixtures_dir):cdk=cdktest.CDKTest("custom",fixtures_dir,binary="npx cdk")returncdk.synthesize()deftest_vpc_count(output):assertlen(output.resources["AWS::EC2::VPC"])==1deftest_subnet_type(output):subnet_output=output.resources["AWS::EC2::Subnet"]tag_list=map(lambdax:x["Tags"],subnet_output)type_count=Counter([item["Value"]forsublistintag_listforiteminsublistifitem["Key"]=="aws-cdk:subnet-type"])assert(type_count["Private"]==2),f'Expected number of Private subnet is 2, got{type_count["Private"]}'assert(type_count["Public"]==2),f'Expected number of Public subnet is 2, got{type_count["Public"]}'CachingThe CDKTest synthesize and deploy methods have the ability to cache its associate output to a local .cdktest-cache directory. This cache directory
will work as a flag. For subsequent calls of the method, the cached folder will be recognized and avoid calling the actual underlyingcdkcommand
again and again. Using the cache flag can be significantly faster than running thecdkcommand again especially if the command is time-intensive.The benefits of the caching feature include:Faster setup time for testing cdk constructs that don't change between testing sessionsPlease see the following example for how to use it:importpytestimportcdktest@pytest.fixture(scope="session")defcdk(request,fixtures_dir):cdk=cdktest.CDKTest(appdir="no_change",basedir=fixtures_dir,binary="npx cdk",enable_cache=request.param,)yieldcdk_LOGGER.debug("Removing cache dir")try:shutil.rmtree(cdk.cache_dir)exceptFileNotFoundError:_LOGGER.debug("%sdoes not exists",cdk.cache_dir)@pytest.mark.parametrize("cdk",[True],indirect=True)deftest_use_cache(cdk):"""Ensures cache is used and runs the execute_command() for first call of themethod only"""formethodincache_methods:withpatch.object(cdk,"execute_command",wraps=cdk.execute_command)asmock_execute_command:for_inrange(2):getattr(cdk,method)(use_cache=True)assertmock_execute_command.call_count==1TestingTests use thepytestframework and have no other dependency except on the Python cdk library.
Package: cdktf-aws-secure
Terraform CDK - AWS Secure constructsThe Level 2 construct can be used to set up your AWS account with the reasonably secure configuration baseline. Internally it uses theTerraform CDKand theAWS Provider.FeaturesAccount password policiesCloudtrailGuarddutyEBS encrypt defaultVPC flow logSecurity HubEnable Config rules aboveInstallJust the constructsnpm install cdktf-aws-secureExamples# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826fromconstructsimportConstructfromcdktfimportResourcefromcdktf_aws_secureimportsecureclassAwsSecure(Resource):def__init__(self,scope,name):super().__init__(scope,name)policy=secure.EnableAccountPasswordPolicy(self,"DefaultAccountPwdPolicy")policy.add_config_rule()# and also add Config rule.# enable guarddutysecure.EnableGuardduty(self,"EnableGuardduty")# enable cloudtrailsecure.EnableCloudTrail(self,"EnableCloudTrail")# enable ebs encrypt defaultsecure.EnableEbsEncryption(self,"EnableEbsEncryption")secure.EnableGuardduty(self,"EnableGuardduty")# enable vpc flow logsecure.EnableVpcFlowLog(self,"EnableVpcFlowLog",vpc_id="vpc-0123456789")# enable security hubsecure.EnableSecurityHub(self,"EnableSecurityHub")DocsSeeAPI Docs
Package: cdktf-cdk8s
CDKTF CDK8sA compatibility layer for usingcdk8sconstructs within Terraform CDK.The cdk8s adapter is in technical preview, which means it's a community supported project. It still requires extensive testing and polishing to mature into a HashiCorp officially supported project. Pleasefile issuesgenerously and detail your experience while using the library. We welcome your feedback.By using the software in this repository, you acknowledge that:The cdk8s adapter is still in development, may change, and has not been released as a commercial product by HashiCorp and is not currently supported in any way by HashiCorp.The cdk8s adapter is provided on an "as-is" basis, and may include bugs, errors, or other issues.The cdk8s adapter is NOT INTENDED FOR PRODUCTION USE, use of the Software may result in unexpected results, loss of data, or other unexpected results, and HashiCorp disclaims any and all liability resulting from use of the cdk8s adapter.HashiCorp reserves all rights to make all decisions about the features, functionality and commercial release (or non-release) of the cdk8s adapter, at any time and without any obligation or liability whatsoever.Compatibilitycdktf>= 0.20.0cdk8s>= 2.8.0constructs>= 10.3.0Usageimport{App,TerraformStack}from"cdktf";import{AppasCDK8sApp,Chart}from"cdk8s";import{CDK8sProvider}from"cdktf-cdk8s";import{MyCdk8sChart}from"./my-cdk8s-chart";exportclassMyKubernetesStackextendsTerraformStack{constructor(scope:Construct,name:string){super(scope,name);constcdk8sApp=newCDK8sApp();//Configureyourcdk8sapplicationlikeusualnewHelloKube(cdk8sApp,"my-chart");//Forpropertiesseehttps://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs//ExtendsontheProviderclassfrom@cdktf/provider-kubernetesnewCDK8sProvider(this,"cdk8s-dev",{configPath:"./kubeconfig.yaml",configContext:"my-dev-cluster",//Onlythecdk8sApppropertyisadded//Thereisnoneedtorunsynthonthecdk8sApp,thisisdonebytheprovidercdk8sApp,});}}constapp=newApp();newMyStack(app,"cdktf-cdk8s");app.synth();ContributingWe welcome your contribution. Please understand that the experimental nature of this repository means that contributing code may be a bit of a moving target. If you have an idea for an enhancement or bug fix, and want to take on the work yourself, please firstcreate an issueso that we can discuss the implementation with you before you proceed with the work.You can review ourcontribution guideto begin.
Package: cdktf-cdktf-provider-acme
CDKTF prebuilt bindings for vancluever/acme provider version 2.20.2This repo builds and publishes theTerraform acme providerbindings forCDK for Terraform.Available PackagesNPMThe npm package is available athttps://www.npmjs.com/package/@cdktf/provider-acme.npm install @cdktf/provider-acmePyPIThe PyPI package is available athttps://pypi.org/project/cdktf-cdktf-provider-acme.pipenv install cdktf-cdktf-provider-acmeNugetThe Nuget package is available athttps://www.nuget.org/packages/HashiCorp.Cdktf.Providers.Acme.dotnet add package HashiCorp.Cdktf.Providers.AcmeMavenThe Maven package is available athttps://mvnrepository.com/artifact/com.hashicorp/cdktf-provider-acme.<dependency>
    <groupId>com.hashicorp</groupId>
    <artifactId>cdktf-provider-acme</artifactId>
    <version>[REPLACE WITH DESIRED VERSION]</version>
</dependency>GoThe go package is generated into thegithub.com/cdktf/cdktf-provider-acme-gopackage.go get github.com/cdktf/cdktf-provider-acme-go/acme/<version>Where<version>is the version of the prebuilt provider you would like to use e.g.v11. The full module name can be found
within thego.modfile.DocsFind auto-generated docs for this provider here:TypescriptPythonJavaC#GoYou can also visit a hosted version of the documentation onconstructs.dev.VersioningThis project is explicitly not tracking the Terraform acme provider version 1:1. In fact, it always trackslatestof~> 2.10with every release. If there are scenarios where you explicitly have to pin your provider version, you can do so bygenerating the provider constructs manually.These are the upstream dependencies:CDK for TerraformTerraform acme providerTerraform EngineIf there are breaking changes (backward incompatible) in any of the above, the major version of this project will be bumped.Features / Issues / BugsPlease report bugs and issues to theCDK for Terraformproject:Create bug reportCreate feature requestContributingProjenThis is mostly based onProjen, which takes care of generating the entire repository.cdktf-provider-project based on ProjenThere's a customproject builderwhich encapsulate the common settings for allcdktfprebuilt providers.Provider VersionThe provider version can be adjusted in./.projenrc.js.Repository ManagementThe repository is managed byCDKTF Repository Manager.
Package: cdktf-cdktf-provider-ad
CDKTF prebuilt bindings for hashicorp/ad provider version 0.4.4HashiCorp made the decision to stop publishing new versions of prebuiltTerraform ad providerbindings forCDK for Terraformon January 18, 2024. As such, this repository has been archived and is no longer supported in any way by HashiCorp. Previously-published versions of this prebuilt provider will still continue to be available on their respective package managers (e.g. npm, PyPi, Maven, NuGet), but these will not be compatible with new releases ofcdktfpast0.20.0and are no longer eligible for commercial support.As a reminder, you can continue to use thehashicorp/adprovider in your CDK for Terraform (CDKTF) projects, even with newer versions of CDKTF, but you will need to generate the bindings locally. The easiest way to do so is to use theprovider addcommand, optionally with the--force-localflag enabled:cdktf provider add hashicorp/ad --force-localFor more information and additional examples, check out our documentation ongenerating provider bindings manually.Deprecated PackagesNPMThe npm package is available athttps://www.npmjs.com/package/@cdktf/provider-ad.npm install @cdktf/provider-adPyPIThe PyPI package is available athttps://pypi.org/project/cdktf-cdktf-provider-ad.pipenv install cdktf-cdktf-provider-adNugetThe Nuget package is available athttps://www.nuget.org/packages/HashiCorp.Cdktf.Providers.Ad.dotnet add package HashiCorp.Cdktf.Providers.AdMavenThe Maven package is available athttps://mvnrepository.com/artifact/com.hashicorp/cdktf-provider-ad.<dependency>
    <groupId>com.hashicorp</groupId>
    <artifactId>cdktf-provider-ad</artifactId>
    <version>[REPLACE WITH DESIRED VERSION]</version>
</dependency>GoThe go package is generated into thegithub.com/cdktf/cdktf-provider-ad-gopackage.go get github.com/cdktf/cdktf-provider-ad-go/ad/<version>Where<version>is the version of the prebuilt provider you would like to use e.g.v11. The full module name can be found
within thego.modfile.DocsFind auto-generated docs for this provider here:TypescriptPythonJavaC#GoYou can also visit a hosted version of the documentation onconstructs.dev.
Package: cdktf-cdktf-provider-archive
CDKTF prebuilt bindings for hashicorp/archive provider version 2.4.2This repo builds and publishes theTerraform archive providerbindings forCDK for Terraform.Available PackagesNPMThe npm package is available athttps://www.npmjs.com/package/@cdktf/provider-archive.npm install @cdktf/provider-archivePyPIThe PyPI package is available athttps://pypi.org/project/cdktf-cdktf-provider-archive.pipenv install cdktf-cdktf-provider-archiveNugetThe Nuget package is available athttps://www.nuget.org/packages/HashiCorp.Cdktf.Providers.Archive.dotnet add package HashiCorp.Cdktf.Providers.ArchiveMavenThe Maven package is available athttps://mvnrepository.com/artifact/com.hashicorp/cdktf-provider-archive.<dependency>
    <groupId>com.hashicorp</groupId>
    <artifactId>cdktf-provider-archive</artifactId>
    <version>[REPLACE WITH DESIRED VERSION]</version>
</dependency>GoThe go package is generated into thegithub.com/cdktf/cdktf-provider-archive-gopackage.go get github.com/cdktf/cdktf-provider-archive-go/archive/<version>Where<version>is the version of the prebuilt provider you would like to use e.g.v11. The full module name can be found
within thego.modfile.DocsFind auto-generated docs for this provider here:TypescriptPythonJavaC#GoYou can also visit a hosted version of the documentation onconstructs.dev.VersioningThis project is explicitly not tracking the Terraform archive provider version 1:1. In fact, it always trackslatestof~> 2.2with every release. If there are scenarios where you explicitly have to pin your provider version, you can do so bygenerating the provider constructs manually.These are the upstream dependencies:CDK for TerraformTerraform archive providerTerraform EngineIf there are breaking changes (backward incompatible) in any of the above, the major version of this project will be bumped.Features / Issues / BugsPlease report bugs and issues to theCDK for Terraformproject:Create bug reportCreate feature requestContributingProjenThis is mostly based onProjen, which takes care of generating the entire repository.cdktf-provider-project based on ProjenThere's a customproject builderwhich encapsulate the common settings for allcdktfprebuilt providers.Provider VersionThe provider version can be adjusted in./.projenrc.js.Repository ManagementThe repository is managed byCDKTF Repository Manager.