PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, August 21, 2022

[FIXED] How to use parameter from Gitlab in AWS CDK?

 August 21, 2022     amazon-web-services, aws-cdk, environment-variables, gitlab     No comments   

Issue

I am using AWS CDK and want to use parameters stored in Gitlab as variables in CDK build.

Someone tried something like this?


Solution

Solutions found:

  1. Create custom variable in Gitlab (with the same repository as project) in two ways:

    • In pipeline file with project (not sensitive data)

    • In project properties in Gitlab (recomended solution if want to store sensitive params as credentials - those parameters should not be stored with project in file)

  2. Declare custom env in main CDK file (e.x. const CUSTOM_ENV = ${CUSTOM_ENV})

  3. Call cdk deploy with created parameter e.g. cdk deploy $CUSTOM_ENV and the variable will be automatically delivered by Gitlab.

More details how to declare variables - Gitlab docs



Answered By - CeZet
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing