Skip to content
Snippets Groups Projects

Issue #3204816: Add the identifier to tags in AWS to distinguish multiple Cloud Orchestrator access

Files
26
<?php
namespace Drupal\aws_cloud\Entity\Ec2;
/**
* Defines the AwsCloudEntity.
*/
class AwsCloudEntity implements AwsCloudEntityInterface {
private const TAG_FORMAT = '{tag}__{site_uuid}__{cloud_context}';
/**
* Get the key name of the UID tag.
*
* @param string $cloud_context
* The cloud context.
* @param string $tag
* The tag name.
*
* @return string
* The string of tag.
*/
public static function getTagCreatedByUid($cloud_context, $tag = self::TAG_CREATED_BY_UID): string {
$context = [
'{tag}' => $tag,
'{site_uuid}' => \Drupal::config('system.site')->get('uuid'),
'{cloud_context}' => $cloud_context,
];
return strtr(self::TAG_FORMAT, $context);
}
}
Loading