Skip to content

Commit

Permalink
Get rid of the old shit.
Browse files Browse the repository at this point in the history
  • Loading branch information
skinny85 committed Apr 30, 2019
1 parent 06ebbf2 commit 9fc7006
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 177 deletions.

This file was deleted.

1 change: 0 additions & 1 deletion packages/@aws-cdk/cdk/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export * from './tag-manager';
export * from './dependency';

export * from './cloudformation-json';
export * from './cloudformation/cross-account-region-token';
export * from './reference';
export * from './cfn-condition';
export * from './fn';
Expand Down
42 changes: 0 additions & 42 deletions packages/@aws-cdk/cdk/lib/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,13 @@ import { PhysicalNameGenerator } from "./util/physical-name-generator";
* Interface for the Resource construct.
*/
export interface IResource extends IConstruct {
readonly physicalName: string;

readonly tryPhysicalName?: string

assignPhysicalNameIfNotSet(name?: string): boolean;

physicalNameGenerator(): PhysicalNameGenerator;
}

/**
* A construct which represents an AWS resource.
*/
export abstract class Resource extends Construct implements IResource {
private _physicalName?: string;

public get physicalName(): string {
if (this._physicalName === undefined) {
throw new Error(`Construct '${this.node.uniqueId}' has been used in a cross account and/or region fashion, ' +
'but does not have a physical name. Constructs have to have a physical name in order to be used cross account and/or region`);
} else {
return this._physicalName;
}
}

public get tryPhysicalName(): string | undefined {
return this._physicalName;
}

/**
* Assigns a physical name if the Construct does not have one already set.
*
* @param name the physical name to assign to this Construct.
* If not provided, the name will be generated by the object
* returned from {@link #physicalNameGenerator()}
* @returns true if the name was assigned
* (that is, the Construct did not have a physical name set),
* false otherwise
*/
public assignPhysicalNameIfNotSet(name?: string): boolean {
if (this._physicalName) {
return false;
}

name = name || this.physicalNameGenerator().generate();

this._physicalName = name;
return true;
}

/**
* Returns the {@link PhysicalNameGenerator} for this Construct,
* which will be used in {@link #assignPhysicalNameIfNotSet()}
Expand Down

This file was deleted.

0 comments on commit 9fc7006

Please sign in to comment.