Skip to content

Commit

Permalink
feat(ses): add configurationSetArn property on configurationSet resource
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericbarthelet committed Apr 23, 2024
1 parent 1bdd3fa commit 6db21d0
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions packages/aws-cdk-lib/aws-ses/lib/configuration-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ export interface IConfigurationSet extends IResource {
* @attribute
*/
readonly configurationSetName: string;

/**
* The ARN of the configuration set
*
* @attribute
*/
readonly configurationSetArn: string;
}

/**
Expand Down Expand Up @@ -111,15 +118,27 @@ export enum SuppressionReasons {
COMPLAINTS_ONLY = 'COMPLAINTS_ONLY',
}

abstract class ConfigurationSetBase extends Resource implements IConfigurationSet {
public abstract configurationSetName: string;

public get configurationSetArn(): string {
return this.stack.formatArn({
service: 'ses',
resource: 'configuration-set',
resourceName: this.configurationSetName,
});
}
}

/**
* A configuration set
*/
export class ConfigurationSet extends Resource implements IConfigurationSet {
export class ConfigurationSet extends ConfigurationSetBase {
/**
* Use an existing configuration set
*/
public static fromConfigurationSetName(scope: Construct, id: string, configurationSetName: string): IConfigurationSet {
class Import extends Resource implements IConfigurationSet {
class Import extends ConfigurationSetBase {
public readonly configurationSetName = configurationSetName;
}
return new Import(scope, id);
Expand Down

0 comments on commit 6db21d0

Please sign in to comment.