I only changed the VERSIONINFO resource, why is the resource id automatically changed to a number? - mfc

I only changed the VERSIONINFO resource, why is the resource id automatically changed to a number(*.rc file)?
I don't want to resource id change, ho do I use not to change the resource id automatically?
i used visual studio 2012

Related

AWS CDK - Exclude stage name from logical ID of resource

I have a CDK project where initially it was deployed via CLI. I am now wrapping it in a pipelines construct.
Old:
Project
|
Stacks
|
Resources
New:
Project
|
Pipeline
|
Stage
|
Stacks
|
Resources
The issue I'm running into is that there are resources I would rather not be deleted in the application, however adding the stage causes the logical ID's to change to Stage-Stack-Resource from Stack-Resource. I found this article that claims you can provide an id of 'Default' to a resource, and cause it to go unused in the process of making the logical ID. however for some reason when I pass an Id of Default to the stage it simply uses that "Default" literal value instead of omitting it.
End goal is that I can keep my existing cloudformation resources, but have them deployed via this pipeline.
You can override the logical id manually like this:
S3 example:
const cfnBucket = s3Bucket.node.defaultChild as aws_s3.CfnBucket;
cfnBucket.overrideLogicalId('CUSTOMLOGICALID');
However, if you did not specify a logical id initially and do it now, CloudFormation will delete the original resource and create a new one with the new custom logical id because CloudFormation identifies resources by their logical ID.
Stage is something you define and it is not related to CloudFormation. You are probably using it in your Stack name or in your Resource names and that's why it gets included in the logical id.
Based on your project description, the only option to not have any resources deleted is: make one of the pipeline stages use the exact same stack name and resource names (without stage) as the CLI deployed version.
I ended up doing a full redeploy of the application. Luckily this was a development environment where trashing our data stores isn't a huge loss. But would be much more of a concern in a production environment.

Update Cloudformation stack name

I have a CF stack in the name gtm-test-commit-9ttyhf7old. I want to know if there is a way to update the same stack with the new commit ID. Something like gtm-test-commit-9ttyhf7new without creating a new stack altogether.
It's not possible to rename a stack. You have to delete it and create a new one with the name you want.
For most resources, changing the logical name of a resource is
equivalent to deleting that resource and replacing it with a new one.
Any other resources that depend on the renamed resource also need to
be updated and might cause to be replaced. Other resources require you
to update a property (not just the logical name) in order to initiate
an update.
Check out this doc: AWS Official Document

Elastic Beanstalk Application Version in Terraform

I attempted to manage my application versions in my terraform template by parameterising the name. This was an attempt to have a new application version created by our CI process whenever the contents of the application changed. This way in elasticbeanstalk i could keep a list of historic application versions so that i could roll back etc. This didnt work as the same application version was constantly updated and in effect i lost the history of all application versions.
resource "aws_elastic_beanstalk_application_version" "default" {
name = "${var.eb-app-name}-${var.build-number}"
application = "${var.eb-app-name}"
description = "application version created by terraform"
bucket = "${aws_s3_bucket.default.id}"
key = "${aws_s3_bucket_object.default.id}"
}
I then tried to parameterise the logical resource reference name, but this isnt supported by terraform.
resource "aws_elastic_beanstalk_application_version" "${var.build-number}" {
name = "${var.eb-app-name}-${var.build-number}"
application = "${var.eb-app-name}"
description = "application version created by terraform"
bucket = "${aws_s3_bucket.default.id}"
key = "${aws_s3_bucket_object.default.id}"
}
Currently my solution is to manage my application versions outside of terraform which is disappointing as there are other associated resources such as the S3 bucket and permissions to worry about.
Am i missing something?
As far as Terraform is concerned you are just updating a single EB application version resource there. If you wanted to keep the previous versions around then you might need to try and increment the count of resources that Terraform is managing.
Off the top of my head you could try something like this:
variable "builds" = {
type = list
}
resource "aws_elastic_beanstalk_application_version" "default" {
count = "${length(var.builds)}"
name = "${var.eb-app-name}-${element(builds, count.index)}"
application = "${var.eb-app-name}"
description = "application version created by terraform"
bucket = "${aws_s3_bucket.default.id}"
key = "${aws_s3_bucket_object.default.id}"
}
Then if you have a list of builds it should create a new application version for each build.
Of course that could be dynamic in that the variable could instead be a data source that returns a list of all your builds. If a data source doesn't exist for it already you could write a small script that is used as an external data source.

How to load a ribbon xml as a resource?

I made a ribbon resource at run time, and saved it to a destination. Now when I am trying to load it as a resource, I am unable to do so. Do anyone has any idea how to load a ribbon resource that is created at the run time and is saved to xml?
P.S. .xml file is saved successfully at the required destination.
this->SaveToXMLFile(strFilePathOfXml);
found the solution.Since it is not a native type resource, we have to declare it manually in .rc file, also define in resource.h
Visit the link under to get the clear picture.
msdn link to convert and load xml resource as ribbon

Creating new Resource by Copying Existing resource

In WSO2 gov. registry 4.6.0 I have a resource called 'Project' which has many fields and a lot of data. I want to create multiple projects most of which have the same data as my first project but a few fields change.
I copied the resource using the 'resources->Browse' option and then renamed and moved the copied project under the projects location. I thought this would do the job but I noticed that the resource name is not the new name. It still shows the old project name as the resource name which I cannot edit as I get error (Exception occurred while trying to invoke service method editArtifact).
I also noticed that while using the 'resources->Browse' option the new project name shows up in the browsed directory but not in the actual project when I navigate to the project using the project link.
Is there a way to copy, duplicate and modify an existing resource without having to manually redo all fields in an existing resource again?
Thanks
You should be able to use the Check-in Client provided by WSO2 Governance Registry.
You can checkout the registry to your file system, do changes and check-in those back to the registry.
I hope this helps.