cdklabs / cdklabs/cdk-data-zone

Adding existing domain while creating an Environment

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4
Forks
3
PR merge metrics
No merged PRs in 30d

Description

We are trying to use both versions of CDK: aws-cdk-lib/data-zone and cdklabs/cdk-data-zone. Due to a [issue](https://github.com/cdklabs/cdk-data-zone/pull/8) with the official version, we wanted to use cdklabs to only create an environment. However, we noticed that while "datazone.CfnEnvironment" function in aws-cdk-lib uses string as identifier for domains and projects, the cdklabs uses custom types Iproject and Idomain.

**aws-cdk-lib**: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_datazone.CfnEnvironment.html

**cdklabs**: https://github.com/cdklabs/cdk-data-zone/blob/main/src/environment.ts

Example:
```
// Create a Project within the Domain
// This is of type IProject
const project = domain.createProject('test-project', {
name: 'test-project',
glossaries: Glossaries.fromFile('./resources/glossaries.json'),
forms: Forms.fromFile('./resources/form-metadata.json'),
});

// Create an Environment Profile for the Project
// This is of type IEnvironmentProfile
const environmentProfile = new EnvironmentProfile(stack, 'EnvironmentProfile', {
name: 'dev',
blueprint,
project,
});

// Create an Environment using the Environment Profile
// project and environmentProfile need to be passed as type = IProject and IEnvironmentProfile
new Environment(stack, 'environment', {
project,
name: 'DEV',
environmentProfile,
});
```

However, if I create the project using aws-cdk-lib
```
import { aws_datazone as datazone } from 'aws-cdk-lib';
const cfnProject = new datazone.CfnProject(this, 'MyCfnProject', {
domainIdentifier: 'domainIdentifier',
name: 'name',

// the properties below are optional
description: 'description',
glossaryTerms: ['glossaryTerms'],
});

```

I cant pass cfnProject to cdklabs's new Environment function since it expects IProject.

Is this possible to make the 2 libraries being able to inter-operate?

Contributor guide

Open the contributing guide

Research direction

Start with src/environment.ts and inspect the Environment constructor and its IProject requirement. Compare that contract with aws-cdk-lib's datazone.CfnProject example and determine what interoperability support is needed; done means an existing aws-cdk-lib project can be used when creating a cdklabs Environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.