Here's how to delete a branch both locally and remotely:
Step-by-Step Deletion
Step 1: Switch to a Different Branch First
You can't delete a branch you're currently on:
You can't delete a branch you're currently on:
# Switch to dev or main
git switch dev
# Delete local branch (safe delete - prevents deletion if unmerged)
git branch -d feat/-deployment
# OR force delete (if you get warnings about unmerged changes)
git branch -D feat/-deployment
# Delete remote branch
git push origin --delete feat/-deployment
aws configure ssojson, text, table) my-sso-profile). <your-profile-name> with the name you provided in the aws configure sso step. This
command typically opens your default web browser to the IAM Identity
Center login page, where you authenticate using your organization's
credentials. Once authenticated, the AWS CLI retrieves and caches temporary credentials. --no-browser or --use-device-code options with aws sso login. Use the configured profile. aws s3 ls --profile <your-profile-name>aws sso login again to refresh your credentials. aws sso logout --profile <your-profile-name>
Great rules for our Logitech
Let's imagine we want to import an SNS Topic into our template.
We should have something like this, change region, to and id of the import.
Run to generate the config file for that resource
terraform plan -generate-config-out=generated.tf
A new file will be generated.
Run terraform plan
Then run terraform apply to bring the changes to the state file.
To fully manage the existing resource with your CDK stack (allowing you to modify its properties later), you must perform a Resource Import using the cdk import CLI command, which relies on CloudFormation's import capabilities.
Let's test this with new cdk code, importing a sns topic.
cdk init app --language=python
Create venv
source .venv/bin/activate && pip install -r requirements.txt
We would like import this resource
On the cdk code you need to write the following, referencing the topic.
Run cdk synth to see the cloudformation template
cdk synth
Resources:
MyManagedTopic0CEB7327:
Type: AWS::SNS::Topic
Properties:
TopicName: MyTopic
Metadata:
aws:cdk:path: CdkImportStack/MyManagedTopic/Resource
CDKMetadata:
Type: AWS::CDK::Metadata
Properties:
Analytics: v2:deflate64:H4sIAAAAAAAA/zPcxxxxxxx
Metadata:
aws:cdk:path: CdkImportStack/CDKMetadata/Default
Parameters:
BootstrapVersion:
Type: AWS::SSM::Parameter::Value<String>
Default: /cdk-bootstrap/hnb659fds/version
Description: Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]
Then run and it will ask for the topic arn
cdk import CdkImportStack
You will see on the cloudformation stack the resource imported
The migration from the CloudFormation template to the CDK is done with a single command: cdk migrate. Simply point to the local CloudFormation template file (let’s call it demo-template.yaml), and watch as the CLI converts the template into a CDK application. The output and result from running the command will be a directory comprised of the CDK code and dependencies, but will not deploy the stack.
You can grab the template code from cloudformation.
cdk migrate --stack-name CdkStack --language python --from-path cleaned_template.json
After that the template is under cdk_stack.
Run the code to see the cdk.out code generated.
source .venv/bin/activate
pip install -r CdkStack/requirements.txt
cd CdkStack
cdk deploy
The module n makes version-management easy:
sudo npm install n -g
For the latest stable version:
n stable
For the latest version:
n latest